From 2978ddd09a1c0241c243dfe92d4ada4859fb5dd1 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 25 Mar 2010 09:31:43 +0000 Subject: [PATCH] - bugfix: LSB_FIRST was not working 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@816 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/emac/src/sipo.vhd | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/emac/src/sipo.vhd b/lib/emac/src/sipo.vhd index ebed385..31b98ab 100644 --- a/lib/emac/src/sipo.vhd +++ b/lib/emac/src/sipo.vhd @@ -41,7 +41,7 @@ ARCHITECTURE behavior OF sipo IS -------------------------------------------------------------------------- begin - pre_fin <= shift_cnt_pipe(shift_cnt_pipe'left); + pre_fin <= shift_cnt_pipe(shift_cnt_pipe'left) when msb_first else shift_cnt_pipe(0); dout_en <= out_en; dout_vld <= out_vld; @@ -86,9 +86,17 @@ process(clk) begin if rising_edge(clk) then if rst = '1' or pre_fin = '1' then - shift_cnt_pipe <= (shift_cnt_pipe'left downto 1 => '0') & din_vld; + if (msb_first) then + shift_cnt_pipe <= (shift_cnt_pipe'left downto 1 => '0') & din_vld; + else + shift_cnt_pipe <= din_vld & (shift_cnt_pipe'left downto 1 => '0'); + end if; elsif din_vld = '1' or abort = '1' then - shift_cnt_pipe <= shift_cnt_pipe(shift_cnt_pipe'left-1 downto 0) & din_vld; + if (msb_first) then + shift_cnt_pipe <= shift_cnt_pipe(shift_cnt_pipe'left-1 downto 0) & din_vld; + else + shift_cnt_pipe <= din_vld & shift_cnt_pipe(shift_cnt_pipe'left downto 1); + end if; end if; end if; end process;