Adam Hussey
Junior Member level 3
- Joined
- Sep 28, 2013
- Messages
- 25
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 276
I find this bizarre because one inout port works just fine (PW), but the other one always reports as uninitialized. The code is for a pipeline processor.
if you need more code let me know.
Thanks!
Code:
entity MCProc is
port (PC, PW, Mem_Bus: inout std_logic_vector (31 downto 0); CLK, Reset: in std_logic);
end entity MCProc;
Architecture First of MCProc is
--
component ALU_32
port (A_bus, B_bus: in std_logic_vector(31 downto 0); Q_bus: out std_logic_vector(63 downto 0); Opcode: in Popcode; clk, reset: in std_logic);
end component ALU_32;
--
Signal A, B: std_logic_vector (31 downto 0):= (others => '0');
signal Q: std_logic_vector (63 downto 0):=(others => '0');
Signal Instruction: Tinstruction;
Signal Opcode: Popcode;
signal Wrback: bit;
for ALU_32C: ALU_32 use entity work.ALU_32(Behavior);
--INSTRUCTION CYCLE
begin
ALU_32C: ALU_32 port map (A, B, Q, Opcode, CLK, Reset);
--PControl: Process
P_Fetch: Process
begin
if (Reset /= '0') then
PC <= "00000000000000000000000000000000";
PW <= "00000000000000000000000000000000"; --Set some initial register values here for simplicity & demonstration.
Regfile(0) <="00000000000000000000000000000000"; --Register 0 gets the value '0'
Regfile(1) <="00000000000000000000000000000111"; --Register 1 gets the value '7'
Regfile(2) <="00000000000000000000000000101101"; --Register 2 gets the value '45'
Regfile(3) <="00000000000000000000010000000000"; --Register 3 gets the value '1024'
Regfile(4) <="00000000010001011010001000000000"; --Register 4 gets the value '4563456'
Regfile(5) <="00000000000101010101010101001101"; --Register 5 gets the value '1398093'
end if;
wait until (Reset = '0' and CLK'event and CLK='1');
PW <= Memory(CONV_INTEGER(PC));
PC <= PC + 1;
end Process;
if you need more code let me know.
Thanks!