jamesr
Newbie level 6
- Joined
- Dec 4, 2013
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 136
Hi,
I have the code below which as far I can work out should be connecting a number of components together in a chain, a bit like a ripple carry, but this for a comparator, with MSB first. Is the syntax correct because it does work, if I synthesize the code to see what circuit I get, it seems to create only one comp (LSB), as if its ignoring the other IF statements? I'm just trying link the previous components ports to the next in a particular order?
The msbslice component has AIH,AIL bit, A,B vectors 15, AOG,AOL bit OUT for reference.
M1: for i in 0 to 15 generate
begin
MSB: if i = 15 generate --MSB
comp: component msbslice
port map (AOGc(i),AOLc(i),AI(i) ,BI(i),AOGc(i-1),AOLc(i-1));
end generate MSB;
LSB: if i = 0 generate --LSB
comp1: component msbslice
port map (AOGc(i),AOLc(i),AI(i),BI(i),AOG, AOL);
end generate LSB;
ALB: if i < 15 and i > 0 generate
comp2: component msbslice
port map (AOGc(i+1),AOLc(i+1),AI(i),BI(i),AOGc(i-1),AOLc(i-1));
end generate ALB;
end generate M1;
I have the code below which as far I can work out should be connecting a number of components together in a chain, a bit like a ripple carry, but this for a comparator, with MSB first. Is the syntax correct because it does work, if I synthesize the code to see what circuit I get, it seems to create only one comp (LSB), as if its ignoring the other IF statements? I'm just trying link the previous components ports to the next in a particular order?
The msbslice component has AIH,AIL bit, A,B vectors 15, AOG,AOL bit OUT for reference.
M1: for i in 0 to 15 generate
begin
MSB: if i = 15 generate --MSB
comp: component msbslice
port map (AOGc(i),AOLc(i),AI(i) ,BI(i),AOGc(i-1),AOLc(i-1));
end generate MSB;
LSB: if i = 0 generate --LSB
comp1: component msbslice
port map (AOGc(i),AOLc(i),AI(i),BI(i),AOG, AOL);
end generate LSB;
ALB: if i < 15 and i > 0 generate
comp2: component msbslice
port map (AOGc(i+1),AOLc(i+1),AI(i),BI(i),AOGc(i-1),AOLc(i-1));
end generate ALB;
end generate M1;