The goal is to create a mechanism to automatically catch unqiue case
violations and have them reported to the test-bench for error counting during simulation. The log files can be huge making post processing less practical. Manually creating assertions is error prone (especially when then one-hot condition is not a continuous bus like the code below) and and a never ending assignment while the design is in development.
always_comb begin
unique case(1'b1)
a[3] : b = 4'h3;
a[2] : b = 4'h2;
c[10] : b = 4'hE;
c[8] : b = 4'h4;
endcase
end
I can enable/disable the reporting for unique case
violations with $assertcontrol
, therefore I believe it is possible to use VPI callback, but I'm having trouble using vpi_iterate()
to find the unique case
, currently I'm slowly traversing the design trying to figure out when to pass what kind of object my vpiHandle
is pointing to. I tried vpi_iterate(vpiCallback, NULL)
, but my simulator returns a a massage stating vpiCallback
has not been implemented yet.
The simulator is reporting unique case
violations to the log file. So how can I get my test-bench to detect it?