I think I found a rather strange bug in the okTriggerOut simulation model (don’t know if ngc behaves similarly).
I am using FrontPanel 3 along with the precompiled files for ModelSimXE62G. All coming from the CD-ROM from an XEM3010 purchased about 1 year ago.
I call UpdateTriggerOuts() then IsTriggered() which responds with a ‘not triggered’ response. Simulation clearly shows that the trigger occurred. ep_clk is connected to a 10MHz clock and ti_clk is 48MHz. ep_trigger is synchronous to the ep_clk. I happen to be using ep_address 63h. This combination seems to have exposed the bug.
The okTriggerOut’s ok2 signal drives the value of the endpoint’s internal trigger status register during the UpdateTriggerOut() function call. Strangely, the value of the ok2 signal changes on the rising edge of ep_clk!!! The ok2 signal should be synchronous to the ti_clk and should not be affected by ep_clk’s rising edge.
I don’t have the RTL code for the opTriggerOut but I can see the signals in simulation and attempt to understand how it works. See attached files for the following explanation.
first image: Bit 0 of the ep_trigger input is pulsed before the screen capture starts. It seems that the captrig signal is sampled on ti_clk’rising_edge (see oval highlight). captrig is sampled on ep_clk’rising_edge twice, resulting in the captrig1 signal. The trighold signal samples eptrig on ep_clk’rising edge if captrig1 /= captrig0. trighold is used to drive ok2 which is currently being read by the okHostInterface block.
second image: This is a close up of the first image showing ok2 changing from Z0000 to Z0001. The okHostInterface samples the ok2 signal on ti_clk’falling_edge but gets the wrong value (Z0000).
Please verify that this is in fact a bug and that I’m not doing something wrong. Also please let me know if the bug exists in the ngc file. In the meantime, I will simply use an endpoint with a higher address that gets read by okHostInterface after trighold is stable.
My guess is that captrig0 and 1 and trighold should be on the ti_clk domain, not the ep_clk domain.
oktriggerout bug1.jpg (103.0 KB)
oktriggerout bug2.jpg (98.7 KB)