Open Martoni opened 4 years ago
Hi @Martoni, could you please also file an issue in the firrtl repository? This bug seems to be mostly related to functionality provided by the firrtl
compiler: https://github.com/freechipsproject/firrtl
After some discussion on the firrtl
bug tracker it turns out that @Martoni needs a way to not emit the ResetCounter
and TestCase
modules. This feature would need to be added in chisel-formal
since that's where these modules come from.
I' wondering if it's possible to add this option in src/main/scala/chisel3/formal/formal/Driver.scala
or if it should be put somewhere else ?
Sorry for the slow follow-up from me.
@Martoni is it the case that if these two modules had a Verilog timescale set then that would fix the issue for you? If so that's probably the easiest fix, I can add that relatively quickly.
@Martoni is it the case that if these two modules had a Verilog timescale set then that would fix the issue for you? If so that's probably the easiest fix, I can add that relatively quickly.
If it's the easiest way I can test it yes. But I don't know if it's the solution.
Sorry that it's taken me so very long to follow up on this. I just added timescale to those two modules in 1add8e6d5b233d37ce1ee54df148eb4d1ff64046. Does that fix your use case?
Does that fix your use case?
I will try it.
It's work with verilator. But it would really be better if ResetCounter and TestCase are not generated. But it's work as it.
This lines should be removed from pure verilog sources I think :
wire ResetCounter_clock; // @[Formal.scala 14:36]
wire ResetCounter_reset; // @[Formal.scala 14:36]
wire [31:0] ResetCounter_numResets; // @[Formal.scala 14:36]
wire [31:0] ResetCounter_timeSinceReset; // @[Formal.scala 14:36]
wire [31:0] TestCase_testCase; // @[Formal.scala 20:32]
ResetCounter ResetCounter ( // @[Formal.scala 14:36]
.clock(ResetCounter_clock),
.reset(ResetCounter_reset),
.numResets(ResetCounter_numResets),
.timeSinceReset(ResetCounter_timeSinceReset)
);
TestCase TestCase ( // @[Formal.scala 20:32]
.testCase(TestCase_testCase)
);
I made a quick&dirty script to suppress it.
Maybe the code to modify is in FIRRTL package here. But I'm not good enough in Scala to do it.
It might also help to write these modules in Chisel instead of Verilog. Looking at this implementation might help: https://github.com/ekiwi/kiwi-formal/blob/d9be8efab5e8b7c7f04410ca943299b441bf1dad/src/kiwi/formal/VerificationAspect.scala#L20
As comment say :
It's impossible to generate verifications statement in standard verilog file
*.v
. So, is it possible to generate formal specific code only for System Verilog generated code*.sv
?Because code added by Formal module generate some verilator compilation error in my simulation, then I have to comment the trait (
// with Formal {
) each time I want to launch simulation.If I comment the trait, it's ok.