Guest
Sorry about the non-descriptive title, I couldn't think of much more
specific.
Anyway, I'm building an IDE device, and I have the following code :
signal REG_DRV_ADDY: std_logic_vector(0 to 7);
constant REG_DRV_HEAD_DRV: integer:=4;
....
begin
debug<=REG_DRV_HEAD(REG_DRV_HEAD_DRV);
-- convienece
csda(0 to 1) <= not(CS);
csda(2 to 4) <= DA;
-- main logic
process(RD, WR, RST
,DATA, csda, REG_STATUS_DATA, sectorbuf_data )
begin
if (RST='0') then
-- reset condition
REG_DRV_HEAD(REG_DRV_HEAD_DRV) <='0';
DATA<=(others=>'Z');
elsif (rd='0') then
-- read strobe
if REG_DRV_HEAD(REG_DRV_HEAD_DRV)='0' then -- are we selected?
if csda=IDE_REG_R_DATA then
sectorbuf_nextbuf<='0';
data(0 to 15)<=sectorbuf_data;
else
sectorbuf_nextbuf<='1';
end if;
else
DATA<=(others=>'Z');
end if;
elsif wr='0' then
-- write strobe
DATA<=(others=>'Z');
if IDE_REG_DRV_HEAD=csda then
REG_DRV_HEAD<=DATA(0 to 7);
end if;
else
-- bus idle
DATA<=(others=>'Z');
end if;
end process;
The effect I'm trying to acheve is that the drive will store writes to
the DRV_HEAD register, and will only respond to reads if the
REG_DRV_HEAD_REG bit of DRV_HEAD register is set to 0. The way I see
this it should work, but in a simulation I get a 'z' on the 'debug'
port (in behavioural) or an X in post-synthesis. The way I read it, the
debug pin should go low when the relevant data bit goes low and the
write strobe is low..
Can anyone help me out, or give me a few pointers? I've uploaded a
screengrab of the simulation - http://i6.tinypic.com/1z22lg5.png .
Thanks.
-Alan
specific.
Anyway, I'm building an IDE device, and I have the following code :
signal REG_DRV_ADDY: std_logic_vector(0 to 7);
constant REG_DRV_HEAD_DRV: integer:=4;
....
begin
debug<=REG_DRV_HEAD(REG_DRV_HEAD_DRV);
-- convienece
csda(0 to 1) <= not(CS);
csda(2 to 4) <= DA;
-- main logic
process(RD, WR, RST
,DATA, csda, REG_STATUS_DATA, sectorbuf_data )
begin
if (RST='0') then
-- reset condition
REG_DRV_HEAD(REG_DRV_HEAD_DRV) <='0';
DATA<=(others=>'Z');
elsif (rd='0') then
-- read strobe
if REG_DRV_HEAD(REG_DRV_HEAD_DRV)='0' then -- are we selected?
if csda=IDE_REG_R_DATA then
sectorbuf_nextbuf<='0';
data(0 to 15)<=sectorbuf_data;
else
sectorbuf_nextbuf<='1';
end if;
else
DATA<=(others=>'Z');
end if;
elsif wr='0' then
-- write strobe
DATA<=(others=>'Z');
if IDE_REG_DRV_HEAD=csda then
REG_DRV_HEAD<=DATA(0 to 7);
end if;
else
-- bus idle
DATA<=(others=>'Z');
end if;
end process;
The effect I'm trying to acheve is that the drive will store writes to
the DRV_HEAD register, and will only respond to reads if the
REG_DRV_HEAD_REG bit of DRV_HEAD register is set to 0. The way I see
this it should work, but in a simulation I get a 'z' on the 'debug'
port (in behavioural) or an X in post-synthesis. The way I read it, the
debug pin should go low when the relevant data bit goes low and the
write strobe is low..
Can anyone help me out, or give me a few pointers? I've uploaded a
screengrab of the simulation - http://i6.tinypic.com/1z22lg5.png .
Thanks.
-Alan