[myhdl-list] Re: Cosimulation with the simple FSM example.
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2006-01-04 16:56:48
|
Brendan Rankin wrote: > I'm having some issues getting cosimulation to work with the simple FSM example > an d Icarus. I have two issues: > > 1. I'm seeing an 'x' being assigned to the state value, at some point. > - I can get around this by removing the $finish from the casez statement in > the generated Verilog. > - I suspect that this issue is due to the active-inactive transition of > reset_n. If so, then it's not an issue at all. It's not clear to me what's happening. It would be useful to see the exact code you're using, including the testbench. > 2. It appears that the enum'ed state types are not being properly de-enum'ed. > I get the following traceback: > I can work around this, as well, by simply changing this exception to a print > statement, but it would be nice to have a "fix" for this one. It does appear > that I'm seeing the values of SEARCH, CONFIRM, SYNC...but these are not being > converted to the expected type _enum. Enum is a high-level type with no direct equivalent in Verilog. So the Verilog convertor maps enum items to encoded values. So there is some information loss. Co-simulation has no idea that the Verilog you co-simulate came from a MyHDL conversion, or that you wrote it by hand. So it cannot automatically map the encodings back to the high-level type - you have to do that explicitly (by a map from encodings to enum items, in the MyHDL domain). Thinking about it, I guess that the Enum type should offer some help to make this easier, that is, offer some kind of an interface to retrieve an enum item based on its encoding. But currently it doesn't. > Unless I'm doing something terribly wrong, you should be able to duplicate this > by simply trying to cosimulate the FSM example with Icarus. Please consider posting the code you're using. It always saves time when troubleshooting. Best regards, Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Losbergenlaan 16, B-3010 Leuven, Belgium From Python to silicon: http://myhdl.jandecaluwe.com |