Help on verilog syntax wanted

A

Andy Luotto

Guest
Hi there
looking at the following statemente

assign fifo_wspace = (fifo_count == {1'b1, `cDCDEPTH'b0}) ? {1'b0,
`cDCDEPTH'b0} : {1'b0, {`cDCDEPTH{1'b1}}} - fifo_count;

what is {`cDCDEPTH{1'b1}}} for? In my case parameter cDCDEPTH=8

thanks to who'll reply

Cheers
 
Andy Luotto wrote:
Hi there
looking at the following statemente

assign fifo_wspace = (fifo_count == {1'b1, `cDCDEPTH'b0}) ? {1'b0,
`cDCDEPTH'b0} : {1'b0, {`cDCDEPTH{1'b1}}} - fifo_count;

what is {`cDCDEPTH{1'b1}}} for? In my case parameter cDCDEPTH=8
{n{y}} is the replication operator. It repleats (concatenates) y n
times.

In your case, the expression is equivalent to 8'b11111111.


BTW, I think you have a {} matching problem.

Regards,
Allan
 
allanherriman@hotmail.com wrote:
Andy Luotto wrote:
Hi there
looking at the following statemente

assign fifo_wspace = (fifo_count == {1'b1, `cDCDEPTH'b0}) ? {1'b0,
`cDCDEPTH'b0} : {1'b0, {`cDCDEPTH{1'b1}}} - fifo_count;

what is {`cDCDEPTH{1'b1}}} for? In my case parameter cDCDEPTH=8

{n{y}} is the replication operator. It repleats (concatenates) y n
times.

In your case, the expression is equivalent to 8'b11111111.


BTW, I think you have a {} matching problem.
Ha! No, I have a vision problem.

{`cDCDEPTH{1'b1}} is equivalent to 8'b11111111.
{1'b0, {`cDCDEPTH{1'b1}}} is equivalent to 9'b011111111

Regards,
Allan
 

Welcome to EDABoard.com

Sponsor

Back
Top