Reformat CR file

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
pull/64/head
Anton Blanchard 5 years ago committed by Anton Blanchard
parent 4d9b2a1165
commit 4d0afa3a6d

@ -6,55 +6,55 @@ library work;
use work.common.all; use work.common.all;


entity cr_file is entity cr_file is
port( port(
clk : in std_logic; clk : in std_logic;


d_in : in Decode2ToCrFileType; d_in : in Decode2ToCrFileType;
d_out : out CrFileToDecode2Type; d_out : out CrFileToDecode2Type;


w_in : in WritebackToCrFileType w_in : in WritebackToCrFileType
); );
end entity cr_file; end entity cr_file;


architecture behaviour of cr_file is architecture behaviour of cr_file is
signal crs : std_ulogic_vector(31 downto 0) := (others => '0'); signal crs : std_ulogic_vector(31 downto 0) := (others => '0');
signal crs_updated : std_ulogic_vector(31 downto 0) := (others => '0'); signal crs_updated : std_ulogic_vector(31 downto 0) := (others => '0');
begin begin
cr_create_0: process(all) cr_create_0: process(all)
variable hi, lo : integer := 0; variable hi, lo : integer := 0;
variable cr_tmp : std_ulogic_vector(31 downto 0) := (others => '0'); variable cr_tmp : std_ulogic_vector(31 downto 0) := (others => '0');
begin begin
cr_tmp := crs; cr_tmp := crs;


for i in 0 to 7 loop for i in 0 to 7 loop
if w_in.write_cr_mask(i) = '1' then if w_in.write_cr_mask(i) = '1' then
lo := i*4; lo := i*4;
hi := lo + 3; hi := lo + 3;
cr_tmp(hi downto lo) := w_in.write_cr_data(hi downto lo); cr_tmp(hi downto lo) := w_in.write_cr_data(hi downto lo);
end if; end if;
end loop; end loop;


crs_updated <= cr_tmp; crs_updated <= cr_tmp;
end process; end process;


-- synchronous writes -- synchronous writes
cr_write_0: process(clk) cr_write_0: process(clk)
begin begin
if rising_edge(clk) then if rising_edge(clk) then
if w_in.write_cr_enable = '1' then if w_in.write_cr_enable = '1' then
report "Writing " & to_hstring(w_in.write_cr_data) & " to CR mask " & to_hstring(w_in.write_cr_mask); report "Writing " & to_hstring(w_in.write_cr_data) & " to CR mask " & to_hstring(w_in.write_cr_mask);
end if; end if;
crs <= crs_updated; crs <= crs_updated;
end if; end if;
end process; end process;


-- asynchronous reads -- asynchronous reads
cr_read_0: process(all) cr_read_0: process(all)
begin begin
-- just return the entire CR to make mfcrf easier for now -- just return the entire CR to make mfcrf easier for now
if d_in.read = '1' then if d_in.read = '1' then
report "Reading CR " & to_hstring(crs_updated); report "Reading CR " & to_hstring(crs_updated);
end if; end if;
d_out.read_cr_data <= crs_updated; d_out.read_cr_data <= crs_updated;
end process; end process;
end architecture behaviour; end architecture behaviour;

Loading…
Cancel
Save