Line 2... |
Line 2... |
//
|
//
|
// Filename: wbscope_tb.v
|
// Filename: wbscope_tb.v
|
//
|
//
|
// Project: WBScope, a wishbone hosted scope
|
// Project: WBScope, a wishbone hosted scope
|
//
|
//
|
// Purpose:
|
// Purpose: This file is a test bench wrapper around the wishbone scope,
|
|
// designed to create a "signal" which can then be scoped and
|
|
// proven. In our case here, the "signal" is a counter. When we test
|
|
// the scope within our bench/cpp Verilator testbench, we'll know if our
|
|
// test was "correct" if the counter 1) only ever counts by 1, and 2) if
|
|
// the trigger lands on thte right data sample.
|
//
|
//
|
// Creator: Dan Gisselquist, Ph.D.
|
// Creator: Dan Gisselquist, Ph.D.
|
// Gisselquist Technology, LLC
|
// Gisselquist Technology, LLC
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
Line 33... |
Line 38... |
//
|
//
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
//
|
//
|
module wbscope_tb(i_clk, i_rst, i_trigger, o_data,
|
module wbscope_tb(i_clk,
|
|
// i_rst is required by our test infrastructure, yet unused here
|
|
i_rst,
|
|
// The test data. o_data is internally generated here from a
|
|
// counter, i_trigger is given externally
|
|
i_trigger, o_data,
|
|
// Wishbone bus interaction
|
i_wb_cyc, i_wb_stb, i_wb_we, i_wb_addr, i_wb_data,
|
i_wb_cyc, i_wb_stb, i_wb_we, i_wb_addr, i_wb_data,
|
o_wb_ack, o_wb_data, o_interrupt);
|
// wishbone bus outputs
|
|
o_wb_ack, o_wb_stall, o_wb_data,
|
|
// And our output interrupt
|
|
o_interrupt);
|
input i_clk, i_rst, i_trigger;
|
input i_clk, i_rst, i_trigger;
|
output wire [31:0] o_data;
|
output wire [31:0] o_data;
|
//
|
//
|
input i_wb_cyc, i_wb_stb, i_wb_we;
|
input i_wb_cyc, i_wb_stb, i_wb_we;
|
input i_wb_addr;
|
input i_wb_addr;
|
input [31:0] i_wb_data;
|
input [31:0] i_wb_data;
|
//
|
//
|
output wire o_wb_ack;
|
output wire o_wb_ack;
|
|
output wire o_wb_stall;
|
output wire [31:0] o_wb_data;
|
output wire [31:0] o_wb_data;
|
//
|
//
|
output o_interrupt;
|
output o_interrupt;
|
|
|
reg [30:0] counter;
|
reg [30:0] counter;
|
Line 57... |
Line 72... |
|
|
assign o_data = { i_trigger, counter };
|
assign o_data = { i_trigger, counter };
|
|
|
wire wb_stall_ignored;
|
wire wb_stall_ignored;
|
|
|
wbscope #(5'd6, 32, 1)
|
wbscope #(.LGMEM(5'd6), .BUSW(32), .SYNCHRONOUS(1),
|
|
.DEFAULT_HOLDOFF(1))
|
scope(i_clk, 1'b1, i_trigger, o_data,
|
scope(i_clk, 1'b1, i_trigger, o_data,
|
i_clk, i_wb_cyc, i_wb_stb, i_wb_we,
|
i_clk, i_wb_cyc, i_wb_stb, i_wb_we,
|
i_wb_addr, i_wb_data,
|
i_wb_addr, i_wb_data,
|
o_wb_ack, wb_stall_ignored, o_wb_data,
|
o_wb_ack, wb_stall_ignored, o_wb_data,
|
o_interrupt);
|
o_interrupt);
|
|
|
|
assign o_wb_stall = 1'b0;
|
|
|
|
// verilator lint_off UNUSED
|
|
wire [1:0] unused;
|
|
assign unused = { i_rst, wb_stall_ignored };
|
|
// verilator lint_on UNUSED
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|