[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gEDA: Problem with parametrized constant widths in VBS



   parameter        ws=3;
   reg [ws-1:0]     state_reg;
   parameter        IDLE = ws'h0, ADR = ws'h7, RD1 = ws'h6, RD2 = ws'h3,
                    WR1 = ws'h4, WR2 = ws'h5 ;

ahvezda@seul.org said:
> With such definitions, the "state_reg = ADR;" statement results in
> setting state_reg to 3

Just to clarify, you are saying that the subsequent statement

	state_reg = ADR;
	$display("state_reg = %b", state_reg);

causes the output "state_reg = 011"? What happens if you replace "ADR = ws'h7"
with "ADR = 3'h7"?

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."