URL
https://opencores.org/ocsvn/wb4pb/wb4pb/trunk
[/] [wb4pb/] [trunk/] [sim/] [hdl/] [picoblaze_wb_gpio_tb.v] - Diff between revs 2 and 18
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 2 |
Rev 18 |
Line 45... |
Line 45... |
`timescale 1 ns / 1 ps
|
`timescale 1 ns / 1 ps
|
|
|
|
|
module picoblaze_wb_gpio_tb;
|
module picoblaze_wb_gpio_tb;
|
|
|
reg rst;
|
reg rst_n;
|
reg clk;
|
reg clk;
|
|
|
wire[7:0] gpio;
|
wire[7:0] gpio;
|
|
|
parameter PERIOD = 20;
|
parameter PERIOD = 20;
|
|
|
reg[7:4] test_data_in;
|
reg[7:4] test_data_in;
|
|
|
|
// system signal generation
|
initial begin
|
initial begin
|
test_data_in = 4'h0;
|
test_data_in = 4'h0;
|
clk = 1'b1;
|
clk = 1'b1;
|
rst = 1'b1;
|
rst_n = 1'b0;
|
#(PERIOD*2) rst = 1'b0;
|
#(PERIOD*2) rst_n = 1'b1;
|
end
|
end
|
always #(PERIOD/2) clk = ! clk;
|
always #(PERIOD/2) clk = ! clk;
|
|
|
always #2500 test_data_in = test_data_in + 1;
|
// 4 bit counting data, changing after some micro seconds
|
|
always #3000 test_data_in = test_data_in + 1;
|
|
// stimulus at upper gpio nibble
|
assign gpio[7:4] = test_data_in;
|
assign gpio[7:4] = test_data_in;
|
|
|
|
// design under test instance
|
picoblaze_wb_gpio dut (
|
picoblaze_wb_gpio dut (
|
.p_rst_i(rst),
|
.p_rst_n_i(rst_n),
|
.p_clk_i(clk),
|
.p_clk_i(clk),
|
|
|
.p_gpio_io(gpio)
|
.p_gpio_io(gpio)
|
);
|
);
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.