core.py: Only create verilator object if there is a section
sections.py: Make VerilatorSection buildable

This is to prepare for coming changes in verilator.py that will
only load a single .a file from each core instead of loading the object
files
verilator.py: Load archives from cores instead of building directly
sections.py: Make systemC test benches buildable again

The refactoring done to build archives from verilator sections
broke systemC test benches. This should fix it again
verilator.py: Allow src_files in top-level core and use pyhon which

This fixes a bug where src_files were not allowed in the top-level
core. It also removes the need to call the external 'which' command
and instead uses a python implementation copied from twisted

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
utils: add colored print functions

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
fusesoc.in: use new colorized print functions

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
utils: add helpers for finding verilator and VERILATOR_ROOT

find_verilator code is factored out from verilator.py.
get_verilator_root relies on the fact that verilator will print
the hardcoded value for VERILATOR_ROOT when fed '-V' as an
argument.
verilator: use find_verilator() helper
sections: use get_verilator_root to obtain VERILATOR_ROOT
sections: add src_root to verilator build include

This solves a problem with inter-core dependencies,
where header files have to be shared between cores.
Doing it this way, cores can include files from other cores by:
#include <other-core/file.h>

The alternative would be for each core to export an include
path, but this might result in namespace clashes between include
files from different cores. Plus, it would be messier to
implement in fusesoc.
verilator: use --start-group/--end-group on archives only

I don't really have an excellent rational behind this,
other than it fixes a real-world problem I had when compiling
several cores depending on each other, and it doesn't seem to
break anything else.
sections: add CPP source_type