- minor improvements for load/store shifter

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@430 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2009-04-15 13:21:39 +00:00
parent 1c5db27de0
commit a3c4ba6e82
+15 -19
View File
@@ -264,7 +264,7 @@ package mips_types is
end record;
type cop0_ctrl_out_t is record
RE : STD_LOGIC;
EB : STD_LOGIC;
exc_inject : STD_LOGIC;
exc_commit : STD_LOGIC;
exc_pending : STD_LOGIC;
@@ -454,16 +454,15 @@ package body mips_types is
function store_be(va : unsigned(1 downto 0); be_src, word2_en, word4_en, align_left, bypass : std_logic) return unsigned is
variable result : unsigned(3 downto 0);
begin
if bypass = '1' then
result := (3 downto 0 => be_src);
elsif word2_en = '1' then
if bypass = '0' then
if word2_en = '1' then
case va is
when "00" | "01" =>
when "00" =>
result := "00" & be_src & be_src;
when "10" | "11" =>
when "10" =>
result := be_src & be_src & "00";
when others =>
result := "0000";
when others => null;
end case;
elsif word4_en = '1' then
case va is
@@ -475,8 +474,7 @@ package body mips_types is
result := '0' & be_src & "00";
when "11" =>
result := be_src & "000";
when others =>
result := "0000";
when others => null;
end case;
elsif align_left = '1' then
case va is
@@ -488,8 +486,7 @@ package body mips_types is
result := be_src & be_src & "00";
when "11" =>
result := be_src & "000";
when others =>
result := "0000";
when others => null;
end case;
else
case va is
@@ -501,10 +498,10 @@ package body mips_types is
result := '0' & be_src & be_src & be_src;
when "11" =>
result := be_src & be_src & be_src & be_src;
when others =>
result := "0000";
when others => null;
end case;
end if;
end if;
return result;
@@ -539,9 +536,9 @@ package body mips_types is
function load_be(va : unsigned(1 downto 0); align_left, bypass : std_logic) return unsigned is
variable result : unsigned(3 downto 0);
begin
if bypass = '1' then
result := (3 downto 0 => '1');
elsif align_left = '1' then
if bypass = '0' then
if align_left = '1' then
case va is
when "00" =>
result := "1000";
@@ -551,8 +548,7 @@ package body mips_types is
result := "1110";
when "11" =>
result := "1111";
when others =>
result := "0000";
when others => null;
end case;
else
case va is
@@ -564,10 +560,10 @@ package body mips_types is
result := "0011";
when "11" =>
result := "0001";
when others =>
result := "0000";
when others => null;
end case;
end if;
end if;
return result;