OpenCores
URL https://opencores.org/ocsvn/pdp1/pdp1/trunk

Subversion Repositories pdp1

[/] [pdp1/] [trunk/] [rtl/] [vhdl/] [ptr_test.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 yannv
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   00:16:45 08/22/2009
6
-- Design Name:   
7
-- Module Name:   /home/yann/fpga/work/pdp1-3/ptr_test.vhd
8
-- Project Name:  pdp1-3
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: papertapereader
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
USE ieee.std_logic_unsigned.all;
31
USE ieee.numeric_std.ALL;
32
 
33
ENTITY ptr_test IS
34
END ptr_test;
35
 
36
ARCHITECTURE behavior OF ptr_test IS
37
 
38
    -- Component Declaration for the Unit Under Test (UUT)
39
 
40
    COMPONENT papertapereader
41
    PORT(
42
         clk : IN  std_logic;
43
         dopulse : IN  std_logic;
44
         done : OUT  std_logic;
45
         io : OUT  std_logic_vector(0 to 17);
46
         io_loaded : IN  std_logic;
47
         ptr_rpa : IN  std_logic;
48
         ptr_rpb : IN  std_logic;
49
         ptr_rrb : IN  std_logic;
50
         rb_loaded : OUT  std_logic;
51
         RXD : IN  std_logic;
52
         TXD : OUT  std_logic
53
        );
54
    END COMPONENT;
55
 
56
 
57
   --Inputs
58
   signal clk : std_logic := '0';
59
   signal dopulse : std_logic := '0';
60
   signal io_loaded : std_logic := '0';
61
   signal ptr_rpa : std_logic := '0';
62
   signal ptr_rpb : std_logic := '0';
63
   signal ptr_rrb : std_logic := '0';
64
   signal RXD : std_logic := '1';
65
 
66
        --Outputs
67
   signal done : std_logic;
68
   signal io : std_logic_vector(0 to 17);
69
   signal rb_loaded : std_logic;
70
   signal TXD : std_logic;
71
 
72
   -- Clock period definitions
73
   constant clk_period : time := 20ns;
74
 
75
BEGIN
76
 
77
        -- Instantiate the Unit Under Test (UUT)
78
   uut: papertapereader PORT MAP (
79
          clk => clk,
80
          dopulse => dopulse,
81
          done => done,
82
          io => io,
83
          io_loaded => io_loaded,
84
          ptr_rpa => ptr_rpa,
85
          ptr_rpb => ptr_rpb,
86
          ptr_rrb => ptr_rrb,
87
          rb_loaded => rb_loaded,
88
          RXD => RXD,
89
          TXD => TXD
90
        );
91
 
92
   -- Clock process definitions
93
   clk_process :process
94
   begin
95
                clk <= '0';
96
                wait for clk_period/2;
97
                clk <= '1';
98
                wait for clk_period/2;
99
   end process;
100
 
101
 
102
   -- Stimulus process
103
   stim_proc: process
104
                constant bittime : time := 8.680555us;
105
   begin
106
      -- hold reset state for 100ms.
107
      --wait for 100ms;
108
                wait for 2*bittime;
109
                ptr_rpb <= '1'; dopulse <= '1';
110
                wait for clk_period;
111
                ptr_rpb <= '0'; dopulse <= '0';
112
 
113
                wait for 16*bittime;
114
                -- TODO: show reply data
115
                RXD <= '0'; wait for bittime;
116
                RXD <= '1'; wait for bittime;
117
                RXD <= '0'; wait for bittime;
118
                RXD <= '1'; wait for bittime;
119
                RXD <= '0'; wait for bittime;
120
                RXD <= '0'; wait for bittime;
121
                RXD <= '0'; wait for bittime;
122
                RXD <= '0'; wait for bittime;
123
                RXD <= '1'; wait for bittime;
124
                RXD <= '1'; wait for bittime;           -- first sixbit 000101
125
                wait for 16*bittime;
126
                RXD <= '0'; wait for bittime;
127
                RXD <= '1'; wait for bittime;
128
                RXD <= '1'; wait for bittime;
129
                RXD <= '1'; wait for bittime;
130
                RXD <= '1'; wait for bittime;
131
                RXD <= '1'; wait for bittime;
132
                RXD <= '1'; wait for bittime;
133
                RXD <= '0'; wait for bittime;
134
                RXD <= '0'; wait for bittime;
135
                RXD <= '1'; wait for bittime;                           -- this byte is not marked as binary data and should be skipped
136
                wait for 16*bittime;
137
                RXD <= '0'; wait for bittime;
138
                RXD <= '0'; wait for bittime;
139
                RXD <= '1'; wait for bittime;
140
                RXD <= '1'; wait for bittime;
141
                RXD <= '0'; wait for bittime;
142
                RXD <= '0'; wait for bittime;
143
                RXD <= '0'; wait for bittime;
144
                RXD <= '0'; wait for bittime;
145
                RXD <= '1'; wait for bittime;
146
                RXD <= '1'; wait for bittime;           -- second sixbit 001100
147
                wait for 16*bittime;
148
                RXD <= '0'; wait for bittime;
149
                RXD <= '0'; wait for bittime;
150
                RXD <= '0'; wait for bittime;
151
                RXD <= '0'; wait for bittime;
152
                RXD <= '1'; wait for bittime;
153
                RXD <= '1'; wait for bittime;
154
                RXD <= '1'; wait for bittime;
155
                RXD <= '0'; wait for bittime;
156
                RXD <= '1'; wait for bittime;
157
                RXD <= '1'; wait for bittime;           -- third sixbit 111000
158
 
159
      --wait for clk_period*10;
160
 
161
      -- insert stimulus here 
162
 
163
      wait;
164
   end process;
165
 
166
END;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.