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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [bench/] [verilog/] [tb_openMSP430.v] - Diff between revs 192 and 200

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 192 Rev 200
Line 29... Line 29...
//
//
// *Author(s):
// *Author(s):
//              - Olivier Girard,    olgirard@gmail.com
//              - Olivier Girard,    olgirard@gmail.com
//
//
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// $Rev: 192 $
// $Rev: 200 $
// $LastChangedBy: olivier.girard $
// $LastChangedBy: olivier.girard $
// $LastChangedDate: 2013-12-17 21:15:28 +0100 (Tue, 17 Dec 2013) $
// $LastChangedDate: 2015-01-21 23:01:31 +0100 (Wed, 21 Jan 2015) $
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
`include "timescale.v"
`include "timescale.v"
`ifdef OMSP_NO_INCLUDE
`ifdef OMSP_NO_INCLUDE
`else
`else
`include "openMSP430_defines.v"
`include "openMSP430_defines.v"
Line 99... Line 99...
 
 
// Peripheral templates
// Peripheral templates
wire        [15:0] per_dout_temp_8b;
wire        [15:0] per_dout_temp_8b;
wire        [15:0] per_dout_temp_16b;
wire        [15:0] per_dout_temp_16b;
 
 
// Simple full duplex UART
 
wire        [15:0] per_dout_uart;
 
wire               irq_uart_rx;
 
wire               irq_uart_tx;
 
wire               uart_txd;
 
reg                uart_rxd;
 
 
 
// Timer A
// Timer A
wire               irq_ta0;
wire               irq_ta0;
wire               irq_ta1;
wire               irq_ta1;
wire        [15:0] per_dout_timerA;
wire        [15:0] per_dout_timerA;
reg                inclk;
reg                inclk;
Line 196... Line 189...
wire        [31:0] inst_number;
wire        [31:0] inst_number;
wire        [15:0] inst_pc;
wire        [15:0] inst_pc;
wire    [8*32-1:0] inst_short;
wire    [8*32-1:0] inst_short;
 
 
// Testbench variables
// Testbench variables
 
integer            tb_idx;
integer            error;
integer            error;
reg                stimulus_done;
reg                stimulus_done;
 
 
 
 
//
//
Line 211... Line 205...
 
 
// Debug interface tasks
// Debug interface tasks
`include "dbg_uart_tasks.v"
`include "dbg_uart_tasks.v"
`include "dbg_i2c_tasks.v"
`include "dbg_i2c_tasks.v"
 
 
// Simple uart tasks
 
//`include "uart_tasks.v"
 
 
 
// Verilog stimulus
// Verilog stimulus
`include "stimulus.v"
`include "stimulus.v"
 
 
 
 
//
//
// Initialize ROM
// Initialize Memory
//------------------------------
//------------------------------
initial
initial
  begin
  begin
 
     // Initialize data memory
 
     for (tb_idx=0; tb_idx < `DMEM_SIZE/2; tb_idx=tb_idx+1)
 
       dmem_0.mem[tb_idx] = 16'h0000;
 
 
 
     // Initialize program memory
     #10 $readmemh("./pmem.mem", pmem_0.mem);
     #10 $readmemh("./pmem.mem", pmem_0.mem);
  end
  end
 
 
 
 
//
//
// Generate Clock & Reset
// Generate Clock & Reset
//------------------------------
//------------------------------
initial
initial
  begin
  begin
Line 303... Line 300...
     ta_cci0b                = 1'b0;
     ta_cci0b                = 1'b0;
     ta_cci1a                = 1'b0;
     ta_cci1a                = 1'b0;
     ta_cci1b                = 1'b0;
     ta_cci1b                = 1'b0;
     ta_cci2a                = 1'b0;
     ta_cci2a                = 1'b0;
     ta_cci2b                = 1'b0;
     ta_cci2b                = 1'b0;
     uart_rxd                = 1'b1;
 
     scan_enable             = 1'b0;
     scan_enable             = 1'b0;
     scan_mode               = 1'b0;
     scan_mode               = 1'b0;
  end
  end
 
 
 
 
Line 496... Line 492...
    .ta_cci2a     (ta_cci2a),          // Timer A compare 2 input A
    .ta_cci2a     (ta_cci2a),          // Timer A compare 2 input A
    .ta_cci2b     (ta_cci2b),          // Timer A compare 2 input B
    .ta_cci2b     (ta_cci2b),          // Timer A compare 2 input B
    .taclk        (taclk)              // TACLK external timer clock (SLOW)
    .taclk        (taclk)              // TACLK external timer clock (SLOW)
);
);
 
 
//
 
// Simple full duplex UART (8N1 protocol)
 
//----------------------------------------
 
`ifdef READY_FOR_PRIMETIME
 
omsp_uart #(.BASE_ADDR(15'h0080)) uart_0 (
 
 
 
// OUTPUTs
 
    .irq_uart_rx  (irq_uart_rx),   // UART receive interrupt
 
    .irq_uart_tx  (irq_uart_tx),   // UART transmit interrupt
 
    .per_dout     (per_dout_uart), // Peripheral data output
 
    .uart_txd     (uart_txd),      // UART Data Transmit (TXD)
 
 
 
// INPUTs
 
    .mclk         (mclk),          // Main system clock
 
    .per_addr     (per_addr),      // Peripheral address
 
    .per_din      (per_din),       // Peripheral data input
 
    .per_en       (per_en),        // Peripheral enable (high active)
 
    .per_we       (per_we),        // Peripheral write enable (high active)
 
    .puc_rst      (puc_rst),       // Main system reset
 
    .smclk_en     (smclk_en),      // SMCLK enable (from CPU)
 
    .uart_rxd     (uart_rxd)       // UART Data Receive (RXD)
 
);
 
`else
 
    assign irq_uart_rx   =  1'b0;
 
    assign irq_uart_tx   =  1'b0;
 
    assign per_dout_uart = 16'h0000;
 
    assign uart_txd      =  1'b0;
 
`endif
 
 
 
//
//
// Peripheral templates
// Peripheral templates
//----------------------------------
//----------------------------------
 
 
Line 567... Line 535...
// Combine peripheral data bus
// Combine peripheral data bus
//----------------------------------
//----------------------------------
 
 
assign per_dout = per_dout_dio       |
assign per_dout = per_dout_dio       |
                  per_dout_timerA    |
                  per_dout_timerA    |
                  per_dout_uart      |
 
                  per_dout_temp_8b   |
                  per_dout_temp_8b   |
                  per_dout_temp_16b;
                  per_dout_temp_16b;
 
 
 
 
//
//
Line 582... Line 549...
                         1'b0,                 // Vector 12  (0xFFF8)
                         1'b0,                 // Vector 12  (0xFFF8)
                         1'b0,                 // Vector 11  (0xFFF6)
                         1'b0,                 // Vector 11  (0xFFF6)
                         1'b0,                 // Vector 10  (0xFFF4) - Watchdog -
                         1'b0,                 // Vector 10  (0xFFF4) - Watchdog -
                         irq_ta0,              // Vector  9  (0xFFF2)
                         irq_ta0,              // Vector  9  (0xFFF2)
                         irq_ta1,              // Vector  8  (0xFFF0)
                         irq_ta1,              // Vector  8  (0xFFF0)
                         irq_uart_rx,          // Vector  7  (0xFFEE)
                         1'b0,                 // Vector  7  (0xFFEE)
                         irq_uart_tx,          // Vector  6  (0xFFEC)
                         1'b0,                 // Vector  6  (0xFFEC)
                         1'b0,                 // Vector  5  (0xFFEA)
                         1'b0,                 // Vector  5  (0xFFEA)
                         1'b0,                 // Vector  4  (0xFFE8)
                         1'b0,                 // Vector  4  (0xFFE8)
                         irq_port2,            // Vector  3  (0xFFE6)
                         irq_port2,            // Vector  3  (0xFFE6)
                         irq_port1,            // Vector  2  (0xFFE4)
                         irq_port1,            // Vector  2  (0xFFE4)
                         1'b0,                 // Vector  1  (0xFFE2)
                         1'b0,                 // Vector  1  (0xFFE2)

powered by: WebSVN 2.1.0

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