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

Subversion Repositories m32632

[/] [m32632/] [trunk/] [TRIPUTER/] [TRIPUTER_SIMU.v] - Blame information for rev 35

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 35 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
//
3
//      Version:        0.1
4
//      Date:           2 December 2018
5
//
6
//      Modules contained in this file:
7
//      1. TRIPUTER_SIMU                Simulation Model of TRIPUTER
8
//
9
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10
 
11
`timescale 1ns / 100ps
12
 
13
module TRIPUTER_SIMU;
14
 
15
reg                     RCLK;
16
reg                     RST_N;
17
wire     [9:0]   SSW;
18
wire                    UA_TX;
19
reg                             UA_RX;
20
wire     [4:0]   SRCO;
21
wire    [17:0]   SRAA;
22
wire    [15:0]   SRDB;
23
wire     [6:0]   HEXM;
24
wire     [6:0]   HEXL;
25
wire     [9:0]   LEDR;
26
wire     [7:0]   LEDG;
27
wire                    AUD_XCK;
28
wire                    HDMI_CLK;
29
 
30
TRIPUTER CHIP(
31
        RCLK,
32
        RST_N,
33
        SSW,
34
        UA_TX,
35
        UA_RX,
36
        SRCO,
37
        SRAA,
38
        SRDB,
39
        HEXM,
40
        HEXL,
41
        LEDR,
42
        LEDG,
43
        AUD_XCK,
44
        HDMI_CLK);
45
 
46
        reg              [7:0]   memh [8191:0];   // 16 KB in total
47
        reg              [7:0]   meml [8191:0];
48
        reg              [7:0]   ramh_q,raml_q;
49
 
50
initial // Clock generator
51
  begin
52
    RCLK = 0;
53
    #10 forever #10 RCLK = !RCLK;
54
  end
55
 
56
initial
57
        begin
58
         RST_N = 1'b0;
59
         #105 RST_N = 1'b1;
60
        end
61
 
62
initial
63
        begin
64
         UA_RX = 1'b1;
65
         #100000 UA_RX = 1'b0;
66
          #17360 UA_RX = 1'b1;
67
          #34720 UA_RX = 1'b0;
68
          #52080 UA_RX = 1'b1;
69
          #17360 UA_RX = 1'b0;
70
          #34720 UA_RX = 1'b1;
71
        end
72
 
73
        assign SSW = 10'd0;
74
 
75
        assign SRDB = SRCO[3] ? 16'hzzzz : {ramh_q,raml_q};
76
 
77
        always @(posedge SRCO[2])       // WE
78
                begin
79
                        if (!SRCO[1]) memh[SRAA[12:0]] <= SRDB[15:8];
80
                        if (!SRCO[0]) meml[SRAA[12:0]] <= SRDB[7:0];
81
                end
82
 
83
        always @(negedge RCLK)  // OE
84
                begin
85
                        if (!SRCO[3]) ramh_q <= memh[SRAA[12:0]];
86
                        if (!SRCO[3]) raml_q <= meml[SRAA[12:0]];
87
                end
88
 
89
endmodule
90
 

powered by: WebSVN 2.1.0

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