Executing additional command in Backend that takes the to be generated file

108 Views Asked by At

I'm currently looking for a way to execute iverilog in in Yosys, to be more exact at the write_verilog step.

I need to feed iverilog the file, which will be generated by write_verilog (reason is, I need to uphold the variable source information, which are kept in the yosys attributes).
However the execute() function only writes into the file upon function end.
If I were to call iverlog testbench.v design.v with design.v being the file which is generated through write_verilog, I get an error, telling me it's missing modules.
Is it possible to carry out commands, that depend on the file which is generated after execute() has run through, while still being in the verilog backend?

1

There are 1 best solutions below

0
On

You could use a script instead, to run iverilog after write_verilog, inside a Yosys script a line beginning ! is passed to the shell:

write_verilog design.v
!iverilog testbench.v design.v