URL
https://opencores.org/ocsvn/pdp1/pdp1/trunk
Subversion Repositories pdp1
Compare Revisions
- This comparison shows the changes necessary to convert path
/pdp1
- from Rev 16 to Rev 17
- ↔ Reverse comparison
Rev 16 → Rev 17
/trunk/rtl/vhdl/testtop.vhd
29,7 → 29,7
USE ieee.std_logic_1164.ALL; |
USE ieee.numeric_std.ALL; |
|
--USE ieee.textio.ALL; |
USE std.textio.ALL; |
|
ENTITY testtop IS |
END testtop; |
126,7 → 126,6
-- wait for waittime; |
end send_byte; |
|
|
BEGIN |
|
-- Instantiate the Unit Under Test (UUT) |
180,15 → 179,42
WR => wrote |
); |
|
|
-- Stimulus process |
stim_proc: process |
type bytefile is file of integer; -- TODO: assert 32-bit? |
file rimfile : bytefile; |
variable tapefileword : integer; |
variable tapebytes : signed(31 downto 0); |
begin |
wait for 1ms; |
send_byte("10000101", tx_ready, eot, write_byte, wrote); |
send_byte("00111111", tx_ready, eot, write_byte, wrote); -- ignored, as bit 7 is not set |
send_byte("10000110", tx_ready, eot, write_byte, wrote); |
send_byte("10111000", tx_ready, eot, write_byte, wrote); -- Together 050670 |
file_open(rimfile, "tapefile.rim", READ_MODE); |
while not endfile(rimfile) loop |
--wait for bittime*12; |
wait until received_byte='1'; |
-- I seem to be getting 32-bit signed little endian numbers. |
-- Which naturally don't fit in a byte. |
read (rimfile, tapefileword); |
tapebytes := to_signed(tapefileword, 32); |
--report "Read a word, value: " & integer'image(tapefileword); |
|
send_byte(std_logic_vector(tapebytes(7 downto 0)), tx_ready, eot, write_byte, wrote); |
wait until received_byte='1'; |
send_byte(std_logic_vector(tapebytes(15 downto 8)), tx_ready, eot, write_byte, wrote); |
wait until received_byte='1'; |
send_byte(std_logic_vector(tapebytes(23 downto 16)), tx_ready, eot, write_byte, wrote); |
wait until received_byte='1'; |
send_byte(std_logic_vector(tapebytes(31 downto 24)), tx_ready, eot, write_byte, wrote); |
|
-- send_byte(conv(tapebyte), tx_ready, eot, write_byte, wrote); |
-- send_byte(std_logic_vector(to_signed(integer(tapebyte(0)),8)), tx_ready, eot, write_byte, wrote); |
-- send_byte("10000101", tx_ready, eot, write_byte, wrote); |
-- send_byte("00111111", tx_ready, eot, write_byte, wrote); -- ignored, as bit 7 is not set |
-- send_byte("10000110", tx_ready, eot, write_byte, wrote); |
-- send_byte("10111000", tx_ready, eot, write_byte, wrote); -- Together 050670 |
-- TODO: show reply data |
end loop; |
file_close(rimfile); |
report "Reached end of RIM (paper tape) file"; |
|
wait for CLK_50M_period*10; |
|