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

Subversion Repositories vtach

[/] [vtach/] [trunk/] [vtach_tb.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 wd5gnr
`timescale 1us/1ns
2
module vtach_tb();
3
   reg clk;
4
   reg reset;
5
 
6
   top dut(clk,reset);
7
 
8
    always #1 clk=~clk;
9
 
10
 
11
initial
12
  begin
13
   $dumpfile("vtach_tb.vcd");
14
   $dumpvars;
15
   clk=1'b0;
16
   reset=1'b1;
17
 
18
/*
19
   dut.mem.row0[0]=13'h120;  // load location 1 into acc (acc=500)
20
   dut.mem.row0[1]=13'h500;  // output location 0 (print 101)
21
   dut.mem.row0[2]=13'h033;  // Input to location 33 (X)
22
   dut.mem.row0[3]=13'h533;  // output location 33
23
   dut.mem.row0[4]=13'h200;  // add acc + location 0 (500+101=601)
24
   dut.mem.row0[5]=13'h733;  // sub acc - location 33 (601-X)
25
   dut.mem.row0[6]=13'h610;  // store acc to location 10
26
   dut.mem.row0[7]=13'h510;  // output location 10
27
   dut.mem.row0[8]=13'h820;  // goto location 20
28
 
29
  dut.mem.row2[0]=13'h599;   // output return address from jump (should be 9)
30
  dut.mem.row2[1]=13'h900;  // halt!
31
*/
32
     dut.mem.row0[0]=13'h120;  // load location 20 (10)
33
     dut.mem.row0[1]=13'h622;  // Store to location 22
34
     dut.mem.row0[2]=13'h522;  // output location 22
35
     dut.mem.row0[3]=13'h721;  // subtract [21] (1)
36
     dut.mem.row0[4]=13'h310;  // if negative goto 10
37
     dut.mem.row0[5]=13'h801;  // goto 1
38
     dut.mem.row1[0]=13'h900;  // halt
39
     dut.mem.row2[0]=13'h010;  // constant 10
40
     dut.mem.row2[1]=13'h001;  // constant 1
41
     dut.mem.row2[2]=13'h000;  // workspace
42
 
43
 
44
 
45
//   dut.mem.row0[6]=13'h800;
46
// Only use this line with io_input.v
47
// not with io_input_keyboard.v
48
//   dut.execunit.in.inputvalues[0]=13'h222;
49
   #5 reset=1'b0;
50
  end
51
  endmodule
52
 

powered by: WebSVN 2.1.0

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