Lord Banshee
Golden Member
Ok anyone that know VHDL really good can you answer me this?
I am making a hazard controller for a pipeline MIPS32 CPU and the control logic is going to be huge and i wanted to make some shortcuts.
I wanted to do something like #defines in C for example i would like to turn this vhdl
if EXMEM(31 downto 26) = rtype and IDEX(31 downto 26) = rtype then
if EXMEM(15 downto 11) = IDEX(25 downto 21) then control(1)<='1'; end if;
if EXMEM(15 downto 11) = IDEX(20 downto 16) then control(2)<='1'; end if;
end if;
into this
if EXMEM(opcode) = rtype and IDEX(opcode) = rtype then
if EXMEM(rd) = IDEX(rs) then control(1)<='1'; end if;
if EXMEM(rd) = IDEX(rt) then control(2)<='1'; end if;
end if;
is it possible to so such a thing in VHDL? i know it isn't much but this will make the code much easier to read and less typing... i have 29 instructions and about 8x8x3 conditions to meet so i am looking at ~600 lines of code just set the control bits.
thanks in advance,
Chris
I am making a hazard controller for a pipeline MIPS32 CPU and the control logic is going to be huge and i wanted to make some shortcuts.
I wanted to do something like #defines in C for example i would like to turn this vhdl
if EXMEM(31 downto 26) = rtype and IDEX(31 downto 26) = rtype then
if EXMEM(15 downto 11) = IDEX(25 downto 21) then control(1)<='1'; end if;
if EXMEM(15 downto 11) = IDEX(20 downto 16) then control(2)<='1'; end if;
end if;
into this
if EXMEM(opcode) = rtype and IDEX(opcode) = rtype then
if EXMEM(rd) = IDEX(rs) then control(1)<='1'; end if;
if EXMEM(rd) = IDEX(rt) then control(2)<='1'; end if;
end if;
is it possible to so such a thing in VHDL? i know it isn't much but this will make the code much easier to read and less typing... i have 29 instructions and about 8x8x3 conditions to meet so i am looking at ~600 lines of code just set the control bits.
thanks in advance,
Chris