M
Martin Euredjian
Guest
generate
for(i=0; i <= WIDTH; i=i+1) begin:BIT
if(i != WIDTH)begin:USELESS
myXOR2 x(.O(xor2), .I0(A), .I1(B));
MUXCY m(.O(cy[i+1]), .CI(cy), .DI(A), .S(xor2));
XORCY xc(.O(xorcy), .CI(cy), .LI(xor2));
FDRE f(.Q(SUM), .C(CLK), .CE(CE), .D(xorcy), .R(RST));
end
else begin:USELESS
FDRE f(.Q(SUM), .C(CLK), .CE(CE), .D(cy), .R(RST));
end
end
endgenerate
That should make an adder. No problem.
However, unless I'm missing something about the syntax, I can't seem to use
a simple if...else..then construct without a "begin:<identifier>" being
required. The above instantiates entities with names like:
BIT[0].USELESS.x
BIT[1].USELESS.x
BIT[2].USELESS.x
BIT[3].USELESS.x
....etc.
What I would love to see is:
BIT[0].x
BIT[1].x
BIT[2].x
BIT[3].x
....etc.
Where have I gone astray?
Thanks,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian
To send private email:
0_0_0_0_@pacbell.net
where
"0_0_0_0_" = "martineu"
for(i=0; i <= WIDTH; i=i+1) begin:BIT
if(i != WIDTH)begin:USELESS
myXOR2 x(.O(xor2), .I0(A), .I1(B));
MUXCY m(.O(cy[i+1]), .CI(cy), .DI(A), .S(xor2));
XORCY xc(.O(xorcy), .CI(cy), .LI(xor2));
FDRE f(.Q(SUM), .C(CLK), .CE(CE), .D(xorcy), .R(RST));
end
else begin:USELESS
FDRE f(.Q(SUM), .C(CLK), .CE(CE), .D(cy), .R(RST));
end
end
endgenerate
That should make an adder. No problem.
However, unless I'm missing something about the syntax, I can't seem to use
a simple if...else..then construct without a "begin:<identifier>" being
required. The above instantiates entities with names like:
BIT[0].USELESS.x
BIT[1].USELESS.x
BIT[2].USELESS.x
BIT[3].USELESS.x
....etc.
What I would love to see is:
BIT[0].x
BIT[1].x
BIT[2].x
BIT[3].x
....etc.
Where have I gone astray?
Thanks,
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian
To send private email:
0_0_0_0_@pacbell.net
where
"0_0_0_0_" = "martineu"