Register outputs on loadstore1

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
pull/42/head
Anton Blanchard 5 years ago committed by Anton Blanchard
parent a8f8c54b77
commit 819f820090

@ -13,36 +13,46 @@ entity loadstore1 is
clk : in std_ulogic; clk : in std_ulogic;


l_in : in Decode2ToLoadstore1Type; l_in : in Decode2ToLoadstore1Type;

l_out : out Loadstore1ToLoadstore2Type l_out : out Loadstore1ToLoadstore2Type
); );
end loadstore1; end loadstore1;


architecture behave of loadstore1 is architecture behave of loadstore1 is
signal l : Decode2ToLoadstore1Type; signal r, rin : Loadstore1ToLoadstore2Type;
signal lsu_sum : std_ulogic_vector(63 downto 0); signal lsu_sum : std_ulogic_vector(63 downto 0);
begin begin
-- Calculate the address in the first cycle -- Calculate the address in the first cycle
lsu_sum <= std_ulogic_vector(unsigned(l.addr1) + unsigned(l.addr2)) when l.valid = '1' else (others => '0'); lsu_sum <= std_ulogic_vector(unsigned(l_in.addr1) + unsigned(l_in.addr2)) when l_in.valid = '1' else (others => '0');


loadstore1_0: process(clk) loadstore1_0: process(clk)
begin begin
if rising_edge(clk) then if rising_edge(clk) then
l <= l_in; r <= rin;
end if; end if;
end process; end process;


loadstore1_1: process(all) loadstore1_1: process(all)
variable v : Loadstore1ToLoadstore2Type;
begin begin
l_out.valid <= l.valid; v := r;
l_out.load <= l.load;
l_out.data <= l.data; v.valid := l_in.valid;
l_out.write_reg <= l.write_reg; v.load := l_in.load;
l_out.length <= l.length; v.data := l_in.data;
l_out.byte_reverse <= l.byte_reverse; v.write_reg := l_in.write_reg;
l_out.sign_extend <= l.sign_extend; v.length := l_in.length;
l_out.update <= l.update; v.byte_reverse := l_in.byte_reverse;
l_out.update_reg <= l.update_reg; v.sign_extend := l_in.sign_extend;

v.update := l_in.update;
l_out.addr <= lsu_sum; v.update_reg := l_in.update_reg;

v.addr := lsu_sum;

-- Update registers
rin <= v;

-- Update outputs
l_out <= v;
end process; end process;
end; end;

Loading…
Cancel
Save