11-21-2018 03:33 AM
The code I'm working on uses a couple of clock buffers and a mux to clock the transmit and receive controllers/RAMs for an UDP core (not my code)
U1: ibuf port map ( i => rx_clk, o => rx_clk_ibuf); U2: bufg port map ( i => rx_clk_ibuf, o => rx_clk_int); U3: bufgmux port map ( i0 => tx_clk, i1 => rx_clk_int , S => enable_1Gb , O => tx_clk_int);
This works fine on final hardware, but in ModelSim both rx_clk_int and tx_clk_int become "Undefined" in waveform. I tried initializing the signals with '0' at declaration, but then they just remain 0 through the whole simulation instead. If I directly connect them it works however.
rx_clk_int <= rx_clk; tx_clk_int <= tx_clk;
How can I get those buffers to work in simulation?
Or should I try use pragmas to select between the different code snippets depending on if it's synthesis or simulation? (I only know of "synthesis translate_on/off" though, so I don't know how to make simulator skip code)
11-21-2018 07:47 AM
Hi @sicksystem,
Have you created a clock on tx_clk and rx_clk in your testbench?
If you have initialised them to zero and have no clock then they will remain zero.
Best Regards
Aidan
11-21-2018 10:01 AM
Have you compiled the Xilinx simulation libraries for ModelSim?
11-22-2018 01:22 AM
Yes, the rx_clk and tx_clk work fine, which is why the second code snippet I wrote is working.
To clarify, If I write the second code snippet, everything in the simulation works as expected. All components in the whole system act as I want them to, sending and receiving UDP packets etc. but as soon as I use the clock buffers instead of that direct assignment, the clocks become undefined.
With some experimentation I've come up with the temporary solution of keeping both snippets in the code
U1: ibuf port map ( i => rx_clk, o => rx_clk_ibuf); U2: bufg port map ( i => rx_clk_ibuf, o => rx_clk_int); U3: bufgmux port map ( i0 => tx_clk, i1 => rx_clk_int , S => enable_1Gb , O => tx_clk_int); -- synthesis translate_off rx_clk_int <= rx_clk; tx_clk_int <= tx_clk; -- synthesis translate_on
It seems that ModelSim lets the direct assigments override the buffers, but this way the synthesis will keep using them.
11-22-2018 01:23 AM
@bruce_karaffa wrote:Have you compiled the Xilinx simulation libraries for ModelSim?
If you mean the XilinxCoreLib, then yes it is compiled.
11-22-2018 04:08 PM
Is it a behavioral simulation or timing simulation? What is the clock frequency?
How do the BUFG input signals look like in the waveform?
11-23-2018 04:04 AM
@graces wrote:Is it a behavioral simulation or timing simulation? What is the clock frequency?
How do the BUFG input signals look like in the waveform?
It is a behavioral simulation
rx_clk and tx_clk are inputs to buffers. Technically I can't say if BUFG is failing or not since the signal is Undefined already after IBUF, so of course BUFG becomes Undefined as well.
Frequency 25 MHz
11-25-2018 04:50 PM
It's strange that the output of IBUF remain undefined. It should be just a pass through.
Can you post the test case for a look?