diff options
author | oharboe <oharboe> | 2008-02-21 18:59:45 +0000 |
---|---|---|
committer | oharboe <oharboe> | 2008-02-21 18:59:45 +0000 |
commit | 4a419c5aa7ef974279042ebfba2aed2adab197db (patch) | |
tree | 1b51f6012df8d5fddc5141e2e83abd7cad1772da /zpu/hdl/zpu4/src/io.vhd | |
parent | 4f2caa8713e198e5cc50339a6272c085ff9ad980 (diff) | |
download | zpu-4a419c5aa7ef974279042ebfba2aed2adab197db.zip zpu-4a419c5aa7ef974279042ebfba2aed2adab197db.tar.gz |
* zpu/zpu/hdl/index.html. Sharpened instructions and shows two working
examples. Small & medium ZPU.
* got zpu4/src/simzpu_medium.do working again.
Diffstat (limited to 'zpu/hdl/zpu4/src/io.vhd')
-rw-r--r-- | zpu/hdl/zpu4/src/io.vhd | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/zpu/hdl/zpu4/src/io.vhd b/zpu/hdl/zpu4/src/io.vhd index b5465d1..7dbe36f 100644 --- a/zpu/hdl/zpu4/src/io.vhd +++ b/zpu/hdl/zpu4/src/io.vhd @@ -19,8 +19,8 @@ entity zpu_io is busy : out std_logic;
writeEnable : in std_logic;
readEnable : in std_logic;
- write : in std_logic_vector(7 downto 0);
- read : out std_logic_vector(7 downto 0);
+ write : in std_logic_vector(wordSize-1 downto 0);
+ read : out std_logic_vector(wordSize-1 downto 0);
addr : in std_logic_vector(maxAddrBit downto minAddrBit)
);
end zpu_io;
@@ -45,7 +45,7 @@ begin clk => clk,
areset => areset,
we => timer_we,
- din => write,
+ din => write(7 downto 0),
adr => addr(4 downto 2),
dout => timer_read);
@@ -60,7 +60,7 @@ begin -- timer_we <= '0';
if writeEnable = '1' then
-- external interface
- if addr=x"1000" then
+ if addr=x"2028003" then
-- Write to UART
-- report "" & character'image(conv_integer(memBint)) severity note;
print(l_file, character'val(conv_integer(write)));
@@ -68,20 +68,25 @@ begin -- report "xxx" severity failure;
-- timer_we <= '1';
else
- report "Illegal IO write" severity failure;
+ print(l_file, character'val(conv_integer(write)));
+ report "Illegal IO write" severity warning;
end if;
end if;
- read <= (others => 'U');
+ read <= (others => '0');
if (readEnable = '1') then
if addr=x"1001" then
read <= (0=>'1', others => '0'); -- recieve empty
elsif addr(12)='1' then
- read <= timer_read;
+ read(7 downto 0) <= timer_read;
elsif addr(11)='1' then
- read <= ZPU_Frequency;
+ read(7 downto 0) <= ZPU_Frequency;
+ elsif addr=x"2028003" then
+ read <= (others => '0');
else
- report "Illegal IO read" severity failure;
+ read <= (others => '0');
+ read(8) <= '1';
+ report "Illegal IO read" severity warning;
end if;
end if;
end if;
|