12-24-2018 11:16 AM
I have a simple counter working with 1MHZ zynq processor as the code below. After a while, its value sticks at 0X407 (1031). It means the block cannot produce the right output. I have this problem with the other blocks too. Could you solve this problem? (I attached the behavioral simulation waveform.)
typedef ap_int<64> signal64;
typedef ap_uint<1> boolSignal;
typedef ap_int<3> threeSBit;
typedef ap_int<1> signal1;
#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
#define NOTEQUAL(a,b) (a!=b ? 1 : 0)
#define MAX_TIME 1152921504606846976
using namespace std;
volatile signal64* fnlCntr,
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS PIPELINE
#pragma HLS INTERFACE axis register both port=fnlCntrAXI
#pragma HLS INTERFACE ap_none port=reset
#pragma HLS INTERFACE ap_none port=fnlCntr
static boolSignal lastStage = 0;
static signal64 cntr = 0;
static boolSignal preReset = 0;
if (reset == 1 && preReset == 0)
cntr = 0;
if(cntr < MAX_TIME)
cntr = 0;
*fnlCntr = cntr;
fnlCntrAXI = cntr;
preReset = reset;
12-24-2018 01:28 PM
12-27-2018 12:08 PM
If you can zip up the smallest program and testbench, that exhibits the problem, I will take a look. I don't have the same hardware, so I may not have the same experience. No promises, but it sounds interesting.
What version are you using?
01-11-2019 05:31 PM
I attached the Vivado project and the related files. There are three cpp wiles there, counter.cpp produces the counter value, counterDMA transfers the value to the PS using AXI DMA and fifo to have all counter numbers in the PS, and axilite provides a register, axilite, to have the latest value in the PS.
change NTPPrj.txt to NTPPrj.xpr
change counter.txt to counter.cpp
change counterDMA.txt to counterDMA.cpp
change axilite.txt to axilite.cpp
The VIVADO version is
If you have 2017.4.
Let me know if you have further questions.
01-12-2019 07:22 AM
Your files are incomplete to make buildable project.
That being said.... try this to isolate your issue... It looks like you were using HLS... Create your top-level function... just the counter... stimulate it with a test bench, and verify that must works correctly in isolation.
If that does, try the next level... Insure all your data types are the width you need.
Hope that helps
If so, please mark as solution accepted. Kudos are also welcomed :-)