the signal q is my new clock. But there's the following error:
ERROR:Xst:904 - "counter_prbs.v" line 57: An edge descriptor must be applied to an expression of size 1.
Following is the code (incomplete - only the required part)
// GSR: Global Clock Set/Reset
- Code: Select all
//New clock:
always @ (posedge CLK or posedge GSR)
begin
if(GSR)
q <= 25'b0;
else
q <= (&prbs_25[24:0]) ? !q : q; //No need of the extra assign statement.
end
//Counter
always @ (posedge q or posedge GSR) -----------//ERROR
begin
if(GSR)
count_in <= 0;
else if(dir)
count_in <= count_in + 1;
else
count_in <= count_in - 1;
end
assign COUNT_OUT = count_in;