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

Subversion Repositories lcd_block

[/] [lcd_block/] [trunk/] [hdl/] [iseProject/] [top_hw_testbench.v] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 leonardoar
`timescale 1ns / 1ps
2
/*
3
Top module that will instantiate and connect our DUT (lcd_controller) the ICON, VIO , ILA cores
4 14 leonardoar
For more information refer to this tutorial (Search in docs if link is broken)
5
http://www.stanford.edu/~phartke/chipscope_tutorial.pdf
6
http://www.stanford.edu/class/ee183/handouts.shtml
7 11 leonardoar
*/
8
module top_hw_testbench(
9 13 leonardoar
    input clk,
10 12 leonardoar
         output hw_lcd_e,
11
         output hw_lcd_rs,
12
         output hw_lcd_rw,
13
         output [3:0] hw_lcd_nibble,
14 13 leonardoar
         output hw_strata_flash_disable
15 11 leonardoar
    );
16
 
17
        // Declare some wires to connect the components
18
        wire rst;
19
        wire rs_in,strobe_in;
20
        wire[7:0] data_in, period_clk_ns;
21
        wire [3:0] lcd_nibble;
22
        wire lcd_e,lcd_rs,lcd_rw,disable_flash,done;
23
 
24
        // Declare the ICON wires
25
        wire [35: 0] control0;
26
        wire [35: 0] control1;
27
        // Declare VIO wires
28
        wire [18: 0] async_out;
29
        // Declare ILA wires
30
        wire trig_0;
31
        wire [16:0] data;
32
 
33 15 leonardoar
        // Declare clock DCM multiplier (3)
34
        wire clock3x, clock1x, clockbuf;
35
 
36 11 leonardoar
        // Instantiate our Device under test
37
        lcd_controller DUT (
38
                rst,
39 15 leonardoar
                clock1x,
40 11 leonardoar
                rs_in,
41
                data_in,
42
                strobe_in,
43
                period_clk_ns,
44
                lcd_e,
45
                lcd_nibble,
46
                lcd_rs,
47
                lcd_rw,
48
                disable_flash,
49
                done
50
                );
51 15 leonardoar
 
52
        // Instantiate the module of clock multiplier           
53
         corePLL instance_name (
54
    .CLKIN_IN(clk),
55
    .CLKFX_OUT(clock3x),
56
    .CLKIN_IBUFG_OUT(clockbuf),
57
    .CLK0_OUT(clock1x)
58
    );
59 11 leonardoar
 
60 15 leonardoar
 
61 11 leonardoar
        coreICON integratedController (
62
      .CONTROL0(control0), // INOUT BUS [35:0]
63
      .CONTROL1(control1)
64
                ); // INOUT BUS [35:0]
65
 
66
 
67
        coreILA integratedLogicAnalyser (
68
      .CONTROL(control0), // INOUT BUS [35:0]
69 15 leonardoar
      .CLK(clock3x), // IN
70 11 leonardoar
      .DATA(data), // DATA [16:0];
71
      .TRIG0(trig_0)
72
        ); // IN BUS [0:0]
73
 
74
        coreVIO VIO_inst
75
    (
76 14 leonardoar
      .CONTROL(control1), // INOUT BUS [35:0]
77 16 leonardoar
                .CLK(clock1x),// clock1x clock3x
78
                .SYNC_OUT(async_out)    // The clock must be inverted on the core to garantee a good sample point.
79 14 leonardoar
      //.ASYNC_OUT(async_out)
80 11 leonardoar
        ); // IN BUS [18:0]
81
 
82
        assign trig_0 = lcd_e;
83
        assign {rst, rs_in, data_in, strobe_in, period_clk_ns} = async_out;
84
        assign data = {7'd1,lcd_e, lcd_nibble[3:0], lcd_rs, lcd_rw, disable_flash, done, strobe_in};
85 12 leonardoar
 
86
        // Send all interest output to outside
87 13 leonardoar
        assign hw_lcd_e = lcd_e;
88 12 leonardoar
        assign hw_lcd_rs = lcd_rs;
89
        assign hw_lcd_rw = lcd_rw;
90
        assign hw_lcd_nibble = lcd_nibble;
91 13 leonardoar
        assign hw_strata_flash_disable = disable_flash;
92 11 leonardoar
 
93
endmodule

powered by: WebSVN 2.1.0

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