Commit 623818ee authored by Tristan Gingold's avatar Tristan Gingold Committed by Dimitris Lampridis

rmq rx: remove endianness conversion.

parent 789c76fa
......@@ -118,17 +118,15 @@ begin
-- Data available, store it.
outb_o <= (sel => '1',
adr => std_logic_vector(state.addr),
dat => (snk_i.data(7 downto 0)
& snk_i.data(15 downto 8)
& snk_i.data(7 downto 0)
& snk_i.data(15 downto 8)),
dat => (snk_i.data(15 downto 0)
& snk_i.data(15 downto 0)),
we => '1',
wmask => "0000");
if state.is_even = '1' then
outb_o.wmask <= "0011";
else
outb_o.wmask <= "1100";
else
outb_o.wmask <= "0011";
end if;
if snk_i.error = '1' then
......@@ -142,7 +140,7 @@ begin
if (state.is_hdr_d = '1' and snk_i.hdr = '0') then
-- end of header
outb_o.adr <= c_mqueue_addr_payload;
outb_o.wmask <= "0011";
outb_o.wmask <= "1100";
n_state.addr <= unsigned(c_mqueue_addr_payload);
n_state.state <= CLAIM;
n_state.is_even <= '0';
......
......@@ -106,13 +106,7 @@ test_rmq(void)
{
int i;
char *p;
unsigned *p32;
unsigned *hdr;
union
{
unsigned char b[sizeof(msg)];
unsigned int w[(sizeof(msg) + 3) / 4];
} buf;
puts("#4 rmq\n");
......@@ -135,11 +129,9 @@ test_rmq(void)
hdr = mq_map_in_header(TRTL_RMQ, 0);
if (hdr[1] != ((sizeof (msg) + 3) / 4) * 4 - 2)
failed('R');
p32 = mq_map_in_buffer(TRTL_RMQ, 0);
for (i = 0; i < (sizeof (msg) + 3) / 4; i++)
buf.w[i] = bswap32(p32[i]);
p = mq_map_in_buffer(TRTL_RMQ, 0);
for (i = 0; i < sizeof (msg); i++)
if (buf.b[i] != msg[i])
if (p[i] != msg[i])
failed('r');
mq_discard(TRTL_RMQ, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment