Commit 69c2acd0 authored by Lucas Russo's avatar Lucas Russo

wb_fmc516_test/verilog/*: initial verilog testbench (with errors)

parent 44d0a56d
This diff is collapsed.
action = "simulation"
target = "xilinx"
modules = {"local" : "../../../.." }
files = ["wb_fmc516_tb.v", "defines.v", "timescale.v",
"clk_rst.v"]
vlog_opt = "-i ../../../../sim/regs -i ../../../../sim"
`include "timescale.v"
`include "defines.v"
module clk_rst(
clk_sys_o,
clk_adc_o,
clk_100mhz_o,
clk_200mhz_o,
rstn_o
);
// Defaults parameters
parameter CLK_SYS_PERIOD = `CLK_SYS_PERIOD;
parameter CLK_ADC_PERIOD = `CLK_ADC_PERIOD;
localparam CLK_100MHZ_PERIOD = `CLK_100MHZ_PERIOD;
localparam CLK_200MHZ_PERIOD = `CLK_200MHZ_PERIOD;
// Output Clocks
output reg
clk_sys_o,
clk_adc_o,
clk_100mhz_o,
clk_200mhz_o;
// Output Reset
output reg rstn_o;
// Reset generate
initial
begin
clk_sys_o = 0;
clk_adc_o = 0;
clk_100mhz_o = 0;
clk_200mhz_o = 0;
rstn_o = 0;
#(`RST_SYS_DELAY)
rstn_o = 1;
end
// Clock Generation
always #(CLK_SYS_PERIOD/2) clk_sys_o <= ~clk_sys_o;
always #(CLK_ADC_PERIOD/2) clk_adc_o <= ~clk_adc_o;
always #(CLK_100MHZ_PERIOD/2) clk_100mhz_o <= ~clk_100mhz_o;
always #(CLK_200MHZ_PERIOD/2) clk_200mhz_o <= ~clk_200mhz_o;
endmodule
/*******************************
* Wishbone definitions
*******************************/
// Wishbone Reference Clock
`define WB_CLOCK_PERIOD 10.00
`define WB_RESET_DELAY (4*`WB_CLOCK_PERIOD)
// Wishbone Data Width
`define WB_DATA_BUS_WIDTH 32
// Wishbone Address Width
`define WB_ADDRESS_BUS_WIDTH 32
/*******************************
* ADC (FMC516) definitions
*******************************/
`define ADC_DATA_WIDTH 16
/*******************************
* General definitions
*******************************/
// 100 MHz clock
`define CLK_SYS_PERIOD 10.00
// 100 MHz clock
`define CLK_100MHZ_PERIOD 10.00
// 200 MHz clock
`define CLK_200MHZ_PERIOD 5.00
// 250 MHz clock
`define CLK_ADC_PERIOD 4.0
// Reset Delay
`define RST_SYS_DELAY (4*CLK_SYS_PERIOD)
#!/bin/bash
# Tests for empty parameter
if [ -z $1 ] ; then
echo "You must specify a top module testbench!";
exit 1;
fi
make && make fuse TOP_MODULE=$1 && ./isim_proj -view wave.wcfg -tclbatch isim_cmd -gui
// reference time = 1ns
// precision time = 1ps
`timescale 1ns/1ps
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment