I have a design that can use a wide range of clock frequencies so to make things simple, I am using hi_clock as the base clock of my circuit (which is pure synchronous).
My design has two synchronous counters, Counter1 of 32 bits and Counter 2 of 48 bits and they are read by the host using 2 and 3 WireOuts respectively (ep21, ep20 for Counter1 and ep 2a, 29 and 28 Counter2).
When I read the two counter values from the host API (using a single UpdateWireOuts() and then 5 calls to GetWireOutValue()), I get the correct values about 90% of the times but in the other 10%, some of the ep values are returned as 0xffff.
When the reading is bad, typically all the 5 eps are read as 0xffff but sometimes, just the eps of Counter1 or just the eps of Counter 2 are read as 0xffff and the other counter is read OK. I did not notice so far a case where only some of the eps of Counter1 or Counter2 are bad.
I tried to clock my circuit on both hi_clk, ti_clk, not(ti_clock) but for no avail.
I am pretty sure that my circuit operates properly and the 0xffff values are not actual counter values.
Below is more information that may help identifying the problem. If more inforamtion is needed, please let me know.
Thanks,
Kam
Board configuration:
Device firmware version: 1.3
Device serial number: JVCNkEpdGp
Device device ID: Opal Kelly XEM3010
Host:
HP Workstation xw4200 running Ubuntu.
Compiler
gcc version 3.3.5 (Debian 1:3.3.5-8ubuntu2.1)
Note:
During compilation I get the following warning: /usr/bin/ld: warning: “libstdc++.so.6, needed by ./libokjFrontPanel.so, may conflict with libstdc++.so.5.”
When I run ldd on my executable (called ‘test’) I get:
ldd test
libokjFrontPanel.so => /usr/lib/libokjFrontPanel.so (0xb7ee2000)
libusb-0.1.so.4 => /lib/libusb-0.1.so.4 (0xb7eda000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xb7e20000) < /lib/tls/i686/cmov/libm.so.6 (0xb7dfe000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7df3000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cc6000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7bee000) < /lib/ld-linux.so.2 (0xb7f0f000)
FPGA Flow:
Verilog. Xilinx WebPack 8.1I (on Unbuntu )
PLL Initialization:
if (true == dev->IsOpen()) {
printf(“Found a device: XEM3010\n”);
// Set output 1 to 50 MHz.
okCPLL22393 pll;
pll.SetPLLParameters(0, 400, 48, true);
pll.SetOutputDivider(0, 8);
pll.SetOutputSource(0, okCPLL22393::ClkSrc_PLL0_0);
pll.SetOutputEnable(0, true);
((okCUsbXEM3010 *)dev)->SetPLLConfiguration(pll);;
}
Log output from my test program
153 Reading wire outs, base=0x20, count=2
154 Reading value of ep 0x21: 0x0000 (0)
155 Reading value of ep 0x20: 0x004d (77)
156 Reading wire outs, base=0x28, count=3
157 Reading value of ep 0x2a: 0x0000 (0)
158 Reading value of ep 0x29: 0x0075 (117)
159 Reading value of ep 0x28: 0xd2d2 (53970)
160 Counter1 = 77 (0x004d), Counter2 = 7721682 (0x75d2d2)
161 Reading wire outs, base=0x20, count=2
162 Reading value of ep 0x21: 0x0000 (0)
163 Reading value of ep 0x20: 0x0052 (82)
164 Reading wire outs, base=0x28, count=3
165 Reading value of ep 0x2a: 0x0000 (0)
166 Reading value of ep 0x29: 0x007d (125)
167 Reading value of ep 0x28: 0x3720 (14112)
168 Counter1 = 82 (0x0052), Counter2 = 8206112 (0x7d3720)
169 Reading wire outs, base=0x20, count=2
170 Reading value of ep 0x21: 0xffff (65535)
171 Reading value of ep 0x20: 0xffff (65535)
172 Reading wire outs, base=0x28, count=3
173 Reading value of ep 0x2a: 0xffff (65535)
174 Reading value of ep 0x29: 0xffff (65535)
175 Reading value of ep 0x28: 0xffff (65535)
176 Counter1 = 4294967295 (0xffffffff), Counter2 = 281474976710655 (0xffffffffffff)
177 Reading wire outs, base=0x20, count=2
178 Reading value of ep 0x21: 0x0000 (0)
179 Reading value of ep 0x20: 0x005c (92)
180 Reading wire outs, base=0x28, count=3
181 Reading value of ep 0x2a: 0x0000 (0)
182 Reading value of ep 0x29: 0x008b (139)
183 Reading value of ep 0x28: 0xfe1e (65054)
184 Counter1 = 92 (0x005c), Counter2 = 9174558 (0x8bfe1e)
185 Reading wire outs, base=0x20, count=2
186 Reading value of ep 0x21: 0x0061 (97)
187 Reading value of ep 0x20: 0x0061 (97)
188 Reading wire outs, base=0x28, count=3
189 Reading value of ep 0x2a: 0xffff (65535)
190 Reading value of ep 0x29: 0xffff (65535)
191 Reading value of ep 0x28: 0xffff (65535)
192 Counter1 = 6357089 (0x610061), Counter2 = 281474976710655 (0xffffffffffff)
193 Reading wire outs, base=0x20, count=2
194 Reading value of ep 0x21: 0x0000 (0)
195 Reading value of ep 0x20: 0x0066 (102)
196 Reading wire outs, base=0x28, count=3
197 Reading value of ep 0x2a: 0x0000 (0)
198 Reading value of ep 0x29: 0x009a (154)
199 Reading value of ep 0x28: 0xc398 (50072)
200 Counter1 = 102 (0x0066), Counter2 = 10142616 (0x9ac398)