Comments (6)
There might be a simple way to solve this, even though it's not the prettiest way. FuseSoC has support for running scripts at different stages. pre_run_scripts are executed before the simulation is run, so we could put in a script that checks for gelf.h.
Unfortunately, right now I think that only scripts in the top-level core is run, but that should be easy to fix, so that scripts from all the included cores are run.
If we get a lot of external dependencies, we should probably spend some effort to make a better mechanism for this, but I think this might actually be one of the only external requirements so we don't have to solve it in a completely generic way
from fusesoc.
This sounds like a good enough idea for now! If there is already a good mechanism that will work, no sense inventing a new one before we hit further problems, which probably will not happen any time soon.
I can see pre_run_scripts
was not implemented in any of the cores in the main repo, am I right? If you could implement the solution you mention I could document how the pre_run_scripts
section can be used for things like checking dependencies.
from fusesoc.
I have now made some updates to FuseSoC so that scripts are run for all cores in the dependency lists as well. Now we just need to add the following to elf-loader.core:
[scripts]
pre_run_scripts = check_for_libelf.sh
and add an executable script called check_for_libelf.sh with something like this in it:
echo #include <gelf.h> > test.c
echo void main(void) {} >> test.cgcc test.c || echo "Error: Missing libelf headers"
Not sure what is best practice to search for this, so I'm leaving the last part for someone else to implement.
Note that two more things should be improved as well
- This only applies to simulations. I realized that the scripts executed in the FPGA build flow are fetched from the system file. Need some refactoring here
- Need to break or warn on script exit code. Not sure about best practice here either. Perhaps 0 = success, >0 = warning, <0 = error or something like that. Love to get some input here as well.
from fusesoc.
FuseSoC now aborts on scripts that returns an exit code != 0. Now we just need add the scripts for the missing dependencies
from fusesoc.
Oh well. I added and pushed the scripts as well. Please try it out and close the issue if it works
from fusesoc.
Awesome! Works. Just fixed a little bug in #81
Closing this one.
from fusesoc.
Related Issues (20)
- Add option to never export specific files HOT 2
- Generator Cache doesn't work with --no-export HOT 2
- Builtin fusesoc parsing cores tree command HOT 1
- Feature request: ability to control arguments to Generators HOT 2
- Modelsim with Cocotb [new flow] HOT 2
- Question: Different cores from the same provider HOT 1
- Question: `env` section problem. HOT 3
- Invalid choice: 'migrate-capi1-to-capi2' HOT 1
- Setting vivado parameters using core file HOT 1
- Generator instance that depends on other cores HOT 8
- Bugs of flags only with numeric
- Librarys from git
- fusesoc is not working for tool=QuestaSim in Linux RedHat. HOT 2
- Reseting cache HOT 2
- script order with conditional statements
- Using multiple revisions of the same library in a project
- Is there any way to pass a *value* to an `Edatool`'s`tool_options` attribute via the command line HOT 2
- Fusesoc yosys target creates fusesoc error and a partially complete Makefile
- Variables in script arguments HOT 1
- Dependencies and target-specific files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fusesoc.