Beating my head with this problem for some time now. Any help would be appreciated.
In our top-level test bench we have 84 8-bit registers that we need to set to get the whole thing to start up in a defined state. These are mostly just trim settings, etc (so they don't change during the simulation). Originally we used 84 ADE variables and multibits, but these are a huge pain to set (especially because they have to be in base-10 inside ADE).
We already have a text file with all the register settings as hex values. It would really be best if we could just read this text file in at simulation time. Ok, here is the catch....I want to use SpectreRF in this simulation.
Here is what I tried: I don't need AMS (these are just DC values). So I wrote a verilog-a model instead. I used $fscanf to read the value into an integer at in @(initial_step). I then use integer division and modulus to decompose it into a bunch of bits (each bit is of type integer). I then just assign these with a contribution operator to each of the electrical outputs. (1 = 1V, 0=0V) The solution worked great....but...
The problem with this implementation is that there are hidden states. Clearly I read the file only once at initial_step and so the variables hold this state (=hidden state). Perhaps I could call $fscanf every time step, but that sounds like a bad solution (slow?).
Any ideas anyone?
Thanks in advance!