首次提交

This commit is contained in:
eesimple
2026-03-06 16:22:17 +08:00
commit b8fe9f77ec
465 changed files with 115939 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
#../../../01_source/01_func/IP/*.vhd
../../../01_source/01_func/SRC/ad_da_pack.vhd
../../../01_source/01_func/SRC/com_pack.vhd
../../../01_source/01_func/SRC/ld_pack.vhd
../../../01_source/01_func/SRC/top_pack.vhd
../../../01_source/01_func/IP/*.vhd
../../../01_source/01_func/SRC/*.vhd

View File

@@ -0,0 +1,23 @@
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
echo on
#quit from current runing simulation
quit -sim
#clear the transcript window,only valid in batch mode
if [batch_mode] {
# log /*
} else {
.main clear
}

View File

@@ -0,0 +1,28 @@
svn add . data --depth=empty
svn add . data/*.txt data/*.m
svn add . coverage --depth=empty
svn add . coverage/*.ucdb
svn add . func* --depth=empty
rem walk through all func* director
for /D %%i in (fun*) do (
svn add . %%i/*.sv
svn add . %%i/*.tcl
svn add . %%i/*.do
svn add . %%i/*.mif )
svn add . timing* --depth=empty
rem walk through all func* director
for /D %%i in (timing*) do (
svn add . %%i/*.sv
svn add . %%i/*.tcl
svn add . %%i/*.do
svn add . %%i/*.mif )
svn add --depth=empty . *.tcl *.sv *.v *.bat *.cmd *.f *.do
svn status -v .
svn commit -m "autocommit" .
pause

View File

@@ -0,0 +1,9 @@
//+define+__MICROSATE_SIM__
vip_clock.sv
vip_uart.sv
axil_ram.v
tb.sv
../glbl.v
../../src/stream_rx_if.sv
../../src/wall_timer.sv

View File

@@ -0,0 +1,119 @@
proc relative_to_absolute {relative_path} {
#replace all "../" and count how many "../" occured in the original string
set parent_dir_count [regsub -all {\.\.\/} $relative_path "" sufix_path]
set redir_path [pwd];
#cut the current path by N-times to get the common parent path for both "abs" and "rela"
for {set i 0 } {$i < $parent_dir_count} {incr i} {
set last_dir [file tail redir_path];
regsub /$last_dir $redir_path "" redir_path;
}
set prefix_path $redir_path;
set absolute_path $prefix_path/$sufix_path;
return $absolute_path;
}
proc find_files {root_path } {
list results;
#store the current path
set current_path [pwd];
cd $root_path;
set root_path [pwd];
puts "entering $root_path"
# get all files recusively
foreach element [glob -nocomplain *] {
# entering sub dirs
if { [file isdirectory $element]} {
set subList [find_files $element];
set results [concat $results $subList];
} else {
# only valid source files are filtered
if {[string match "*.v" $element] || [string match "*.sv" $element] || [string match "*.vhd" $element] || [string match "*.vhdl" $element]} {
lappend results "$root_path/$element";
}
}
}
cd $current_path;
return $results;
}
puts "---------------------------------ATTENTION----------------------------------------"
puts "----------- this file should be sourced after the vsim load sucessfully-----------"
puts "----------- this file should be sourced from the funcXXX director-----------------"
puts ""
#write report -l info.txt
puts ":::::::::get referced dut files:::::::::"
set f_report [open info.txt r];
#read the report,get all referenced files
while {![eof $f_report]} {
gets $f_report line
if { [string match "*Source File*" $line] } {
lappend referenced_files $line
}
}
close $f_report
#remove those source file,point to precompiled vendor library
#convert the relative path to absolute path
list referenced_dut_files;
foreach element $referenced_files {
if { [string match "*Source File: \.\./\.\./*" $element] } {
regsub {^.*Source File:} $element "" path
set relative_path [string trim $path ]
set abs_path [relative_to_absolute $relative_path]
lappend referenced_dut_files $abs_path
# puts $abs_path
}
}
puts ":::::::::get all compiled source files:::::::::"
#get all source files in the source file directory ,recursively
set root_path ../../../01_source/01_func;
set all_sources [find_files $root_path ];
puts ":::::::::try to match:::::::::"
#try to match the two lists,and filter the mis-matched ones
set f_referenced_dut_files [open "referenced.txt" w+];
foreach sim_file $referenced_dut_files {
puts $f_referenced_dut_files $sim_file;
}
close $f_referenced_dut_files
set f_dir_files [open "dir.txt" w+];
foreach dir_file $all_sources {
puts $f_dir_files $dir_file;
}
close $f_dir_files
lappend mis_matched_dir_files;
foreach dir_file $all_sources {
puts $dir_file
set index [lsearch $referenced_dut_files $dir_file]
if {$index == -1} {
lappend mis_matched_dir_files $dir_file
puts dir=$dir_file
}
}

View File

@@ -0,0 +1,21 @@
echo off
#useage do addwave.tcl uart,where uart is a module name
#when there is mulitple matches,the 1st one is picked
puts "---->find by design unit:$1"
set patten *$1*;
#puts "---->find patten:$patten"
set rslt [find instance -bydu $patten];
#puts "---->find result:$rslt"
regsub {\{} $rslt "" rslt;
regsub {\}} $rslt "" rslt;
regsub { (.*)} $rslt "" path;
#puts "---->design path is:$path"
set signal_list ${path}/*
puts "---->list to be add to wave:$signal_list"
add wave $signal_list

View File

@@ -0,0 +1,183 @@
/*
Copyright (c) 2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// Language: Verilog 2001
`resetall
`timescale 1ns / 1ps
`default_nettype none
/*
* AXI4-Lite RAM
*/
module axil_ram #
(
// Width of data bus in bits
parameter DATA_WIDTH = 32,
// Width of address bus in bits
parameter ADDR_WIDTH = 32,
// Width of wstrb (width of data bus in words)
parameter STRB_WIDTH = (DATA_WIDTH/8),
// Extra pipeline register on output
parameter PIPELINE_OUTPUT = 0
)
(
input wire clk,
input wire rst,
input wire [ADDR_WIDTH-1:0] s_axil_awaddr,
input wire [2:0] s_axil_awprot,
input wire s_axil_awvalid,
output wire s_axil_awready,
input wire [DATA_WIDTH-1:0] s_axil_wdata,
input wire [STRB_WIDTH-1:0] s_axil_wstrb,
input wire s_axil_wvalid,
output wire s_axil_wready,
output wire [1:0] s_axil_bresp,
output wire s_axil_bvalid,
input wire s_axil_bready,
input wire [ADDR_WIDTH-1:0] s_axil_araddr,
input wire [2:0] s_axil_arprot,
input wire s_axil_arvalid,
output wire s_axil_arready,
output wire [DATA_WIDTH-1:0] s_axil_rdata,
output wire [1:0] s_axil_rresp,
output wire s_axil_rvalid,
input wire s_axil_rready
);
parameter VALID_ADDR_WIDTH = ADDR_WIDTH - $clog2(STRB_WIDTH);
parameter WORD_WIDTH = STRB_WIDTH;
parameter WORD_SIZE = DATA_WIDTH/WORD_WIDTH;
reg mem_wr_en;
reg mem_rd_en;
reg s_axil_awready_reg = 1'b0, s_axil_awready_next;
reg s_axil_wready_reg = 1'b0, s_axil_wready_next;
reg s_axil_bvalid_reg = 1'b0, s_axil_bvalid_next;
reg s_axil_arready_reg = 1'b0, s_axil_arready_next;
reg [DATA_WIDTH-1:0] s_axil_rdata_reg = {DATA_WIDTH{1'b0}}, s_axil_rdata_next;
reg s_axil_rvalid_reg = 1'b0, s_axil_rvalid_next;
reg [DATA_WIDTH-1:0] s_axil_rdata_pipe_reg = {DATA_WIDTH{1'b0}};
reg s_axil_rvalid_pipe_reg = 1'b0;
// (* RAM_STYLE="BLOCK" *)
reg [DATA_WIDTH-1:0] mem[(2**VALID_ADDR_WIDTH)-1:0];
wire [VALID_ADDR_WIDTH-1:0] s_axil_awaddr_valid = s_axil_awaddr >> (ADDR_WIDTH - VALID_ADDR_WIDTH);
wire [VALID_ADDR_WIDTH-1:0] s_axil_araddr_valid = s_axil_araddr >> (ADDR_WIDTH - VALID_ADDR_WIDTH);
assign s_axil_awready = s_axil_awready_reg;
assign s_axil_wready = s_axil_wready_reg;
assign s_axil_bresp = 2'b00;
assign s_axil_bvalid = s_axil_bvalid_reg;
assign s_axil_arready = s_axil_arready_reg;
assign s_axil_rdata = PIPELINE_OUTPUT ? s_axil_rdata_pipe_reg : s_axil_rdata_reg;
assign s_axil_rresp = 2'b00;
assign s_axil_rvalid = PIPELINE_OUTPUT ? s_axil_rvalid_pipe_reg : s_axil_rvalid_reg;
integer i, j;
initial begin
// two nested loops for smaller number of iterations per loop
// workaround for synthesizer complaints about large loop counts
for (i = 0; i < 2**VALID_ADDR_WIDTH; i = i + 2**(VALID_ADDR_WIDTH/2)) begin
for (j = i; j < i + 2**(VALID_ADDR_WIDTH/2); j = j + 1) begin
mem[j] = 0;
end
end
end
always @* begin
mem_wr_en = 1'b0;
s_axil_awready_next = 1'b0;
s_axil_wready_next = 1'b0;
s_axil_bvalid_next = s_axil_bvalid_reg && !s_axil_bready;
if (s_axil_awvalid && s_axil_wvalid && (!s_axil_bvalid || s_axil_bready) && (!s_axil_awready && !s_axil_wready)) begin
s_axil_awready_next = 1'b1;
s_axil_wready_next = 1'b1;
s_axil_bvalid_next = 1'b1;
mem_wr_en = 1'b1;
end
end
always @(posedge clk) begin
s_axil_awready_reg <= s_axil_awready_next;
s_axil_wready_reg <= s_axil_wready_next;
s_axil_bvalid_reg <= s_axil_bvalid_next;
for (i = 0; i < WORD_WIDTH; i = i + 1) begin
if (mem_wr_en && s_axil_wstrb[i]) begin
mem[s_axil_awaddr_valid][WORD_SIZE*i +: WORD_SIZE] <= s_axil_wdata[WORD_SIZE*i +: WORD_SIZE];
end
end
if (rst) begin
s_axil_awready_reg <= 1'b0;
s_axil_wready_reg <= 1'b0;
s_axil_bvalid_reg <= 1'b0;
end
end
always @* begin
mem_rd_en = 1'b0;
s_axil_arready_next = 1'b0;
s_axil_rvalid_next = s_axil_rvalid_reg && !(s_axil_rready || (PIPELINE_OUTPUT && !s_axil_rvalid_pipe_reg));
if (s_axil_arvalid && (!s_axil_rvalid || s_axil_rready || (PIPELINE_OUTPUT && !s_axil_rvalid_pipe_reg)) && (!s_axil_arready)) begin
s_axil_arready_next = 1'b1;
s_axil_rvalid_next = 1'b1;
mem_rd_en = 1'b1;
end
end
always @(posedge clk) begin
s_axil_arready_reg <= s_axil_arready_next;
s_axil_rvalid_reg <= s_axil_rvalid_next;
if (mem_rd_en) begin
s_axil_rdata_reg <= mem[s_axil_araddr_valid];
end
if (!s_axil_rvalid_pipe_reg || s_axil_rready) begin
s_axil_rdata_pipe_reg <= s_axil_rdata_reg;
s_axil_rvalid_pipe_reg <= s_axil_rvalid_reg;
end
if (rst) begin
s_axil_arready_reg <= 1'b0;
s_axil_rvalid_reg <= 1'b0;
s_axil_rvalid_pipe_reg <= 1'b0;
end
end
endmodule
`resetall

View File

@@ -0,0 +1,22 @@
/*
can bus physical model by leguoqing
*/
module can_transceiver
(
output logic rxd = 1,
input logic txd,
inout tri1 line
);
always@(*)
if (line == 1'b0) rxd <= 1'b0;
else rxd <= 1'b1;
logic line_reg;
always@(*)
if (txd == 0) line_reg <= 0;
else line_reg <= 1;
assign line = line_reg ? 1'bz : 0;
endmodule

View File

@@ -0,0 +1,53 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/rx_data
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/rx_ready
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/rx_valid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/ehex
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/ehex_valid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/ehex_ready
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/tx_data
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/tx_ready
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/tx_valid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cli_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_state
eval TreeUpdate \[SetDefaultTree\]
WaveRestoreCursors {{Cursor 1} {1083572000 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 296
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {1083443837 ps} {1083684163 ps}
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}

View File

@@ -0,0 +1,254 @@
//-----------------------------------------------------------------------------
// The confidential and proprietary information contained in this file may
// only be used by a person authorised under and to the extent permitted
// by a subsisting licensing agreement from ARM Limited.
//
// (C) COPYRIGHT 2010-2013 ARM Limited.
// ALL RIGHTS RESERVED
//
// This entire notice must be reproduced on all copies of this file
// and copies of this file may only be made by a person if such person is
// permitted to do so under the terms of a subsisting license agreement
// from ARM Limited.
//
// SVN Information
//
// Checked In : $Date: 2013-02-08 10:40:04 +0000 (Fri, 08 Feb 2013) $
//
// Revision : $Revision: 365823 $
//
// Release Information : CM3DesignStart-r0p0-02rel0
//
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Abstract : A device to capture serial data
//-----------------------------------------------------------------------------
// This module assume CLK is same frequency as baud rate.
// In the example UART a test mode is used to enable data output as maximum
// speed (PCLK). In such case we can connect CLK signal directly to PCLK.
// Otherwise, if the UART baud rate is reduced, the CLK rate has to be reduced
// accordingly as well.
//
// This module stop the simulation when character 0x04 is received.
// An output called SIMULATION_END is set for 1 cycle before simulation is
// terminated to allow other testbench component like profiler (if any)
// to output reports before the simulation stop.
//
// This model also support ESCAPE (0x1B, decimal 27) code sequence
// ESC - 0x10 - XY Capture XY to AUXCTRL output
// ESC - 0x11 Set DEBUG_TESTER_ENABLE to 1
// ESC - 0x12 Clear DEBUG_TESTER_ENABLE to 0
module cmsdk_uart_capture_ard (
input wire RESETn, // Power on reset
input wire CLK, // Clock (baud rate)
input wire RXD, // Received data
output wire SIMULATIONEND, // Simulation end indicator
output wire DEBUG_TESTER_ENABLE, // Enable debug tester
output wire [7:0] AUXCTRL, // Auxiliary control
output wire SPI0, // Shield0 SPI enable
output wire SPI1, // Shield1 SPI enable
output wire I2C0, // Shield0 I2C enable
output wire I2C1, // Shield1 I2C enable
output wire UART0, // Shield0 UART enable
output wire UART1); // Shield1 UART enable
reg [8:0] rx_shift_reg;
wire[8:0] nxt_rx_shift;
reg [6:0] string_length;
reg [7:0] tube_string [127:0];
reg [7:0] text_char;
integer i;
reg nxt_end_simulation;
reg reg_end_simulation;
wire char_received;
reg reg_esc_code_mode; // Escape code mode
reg reg_aux_ctrl_mode; // Auxiliary control capture mode
reg [7:0] reg_aux_ctrl; // Registered Auxiliary control
reg reg_dbgtester_enable;
reg SPI0_reg;
reg SPI1_reg;
reg I2C0_reg;
reg I2C1_reg;
reg UART0_reg;
reg UART1_reg;
// Receive shift register
assign nxt_rx_shift = {RXD,rx_shift_reg[8:1]};
assign char_received = (rx_shift_reg[0]==1'b0);
initial
begin
SPI0_reg <= 1'b0;
SPI1_reg <= 1'b0;
I2C0_reg <= 1'b0;
I2C1_reg <= 1'b0;
UART0_reg <= 1'b0;
UART1_reg <= 1'b0;
end
always @(posedge CLK or negedge RESETn)
begin
if (~RESETn)
rx_shift_reg <= {9{1'b1}};
else
if (rx_shift_reg[0]==1'b0) // Start bit reach bit[0]
rx_shift_reg <= {9{1'b1}};
else
rx_shift_reg <= nxt_rx_shift;
end
// Escape code mode register
always @(posedge CLK or negedge RESETn)
begin
if (~RESETn)
reg_esc_code_mode <= 1'b0;
else // Set to escape mode if ESC code is detected
if (char_received & (reg_esc_code_mode==1'b0) & (rx_shift_reg[8:1]==8'h1B))
reg_esc_code_mode <= 1'b1;
else if (char_received)
reg_esc_code_mode <= 1'b0;
end
// Aux Ctrl capture mode register
always @(posedge CLK or negedge RESETn)
begin
if (~RESETn)
reg_aux_ctrl_mode <= 1'b0;
else // Set to Aux control capture mode if ESC-0x10 sequence is detected
if (char_received & (reg_esc_code_mode==1'b1) & (rx_shift_reg[8:1]==8'h10))
reg_aux_ctrl_mode <= 1'b1;
else if (char_received)
reg_aux_ctrl_mode <= 1'b0;
end
// Aux Ctrl capture data register
always @(posedge CLK or negedge RESETn)
begin
if (~RESETn)
reg_aux_ctrl <= {8{1'b0}};
else // Capture received data to Aux control output if reg_aux_ctrl_mode is set
if (char_received & (reg_aux_ctrl_mode==1'b1))
reg_aux_ctrl <= rx_shift_reg[8:1];
end
assign AUXCTRL = reg_aux_ctrl;
// Debug tester enable
always @(posedge CLK or negedge RESETn)
begin
if (~RESETn)
reg_dbgtester_enable <= 1'b0;
else // Enable debug tester if ESC-0x11 sequence is detected
if (char_received & (reg_esc_code_mode==1'b1) & (rx_shift_reg[8:1]==8'h11))
reg_dbgtester_enable <= 1'b1;
else if (char_received & (reg_esc_code_mode==1'b1) & (rx_shift_reg[8:1]==8'h12))
// Disable debug tester if ESC-0x12 sequence is detected
reg_dbgtester_enable <= 1'b0;
end
assign DEBUG_TESTER_ENABLE = reg_dbgtester_enable;
// Message display
always @ (posedge CLK or negedge RESETn)
begin: p_tube
if (~RESETn)
begin
string_length = 7'b0;
nxt_end_simulation <= 1'b0;
for (i=0; i<= 127; i=i+1) begin
tube_string [i] = 8'h00;
end
end
else
if (char_received)
begin
if ((rx_shift_reg[8:1]==8'h1B) | reg_esc_code_mode | reg_aux_ctrl_mode )
begin
// Escape code, or in escape code mode
// Data receive can be command, aux ctrl data
// Ignore this data
end
else if (rx_shift_reg[8:1]==8'h04) // Stop simulation if 0x04 is received
nxt_end_simulation <= 1'b1;
else if ((rx_shift_reg[8:1]==8'h0d)|(rx_shift_reg[8:1]==8'h0A))
// New line
begin
tube_string[string_length] = 8'h00;
$write("%t UART: ",$time);
for (i=0; i<= string_length; i=i+1)
begin
text_char = tube_string[i];
$write("%s",text_char);
end
$write("\n");
string_length = 7'b0;
end
else if (rx_shift_reg[8:1]==8'h0F)
begin
$write("%t UART: Switching on Shield I2C, SPI and UART\n",$time);
SPI0_reg <= 1'b1;
SPI1_reg <= 1'b1;
I2C0_reg <= 1'b1;
I2C1_reg <= 1'b1;
UART0_reg <= 1'b1;
UART1_reg <= 1'b1;
end
else
begin
tube_string[string_length] = rx_shift_reg[8:1];
string_length = string_length + 1;
if (string_length >79) // line too long, display and clear buffer
begin
tube_string[string_length] = 8'h00;
$write("%t UART: ",$time);
for (i=0; i<= string_length; i=i+1)
begin
text_char = tube_string[i];
$write("%s",text_char);
end
$write("\n");
string_length = 7'b0;
end
end
end
end // p_TUBE
// Delay for simulation end
always @ (posedge CLK or negedge RESETn)
begin: p_sim_end
if (~RESETn)
begin
reg_end_simulation <= 1'b0;
end
else
reg_end_simulation <= nxt_end_simulation;
if (reg_end_simulation==1'b1)
begin
$write("%t UART: Test Ended\n",$time);
$stop;
end
end
assign SIMULATIONEND = nxt_end_simulation & ~reg_end_simulation;
assign SPI0 = SPI0_reg;
assign SPI1 = SPI1_reg;
assign I2C0 = I2C0_reg;
assign I2C1 = I2C1_reg;
assign UART0 = UART0_reg;
assign UART1 = UART1_reg;
endmodule

View File

@@ -0,0 +1,27 @@
::关闭回显
@ECHO OFF
::设置软件路径
SET Debussy=C:\Novas\Debussy\bin\Debussy.exe
SET vericom=C:\Novas\Debussy\bin\vericom.exe
SET vhdlcom=C:\Novas\Debussy\bin\vhdlcom.exe
::===== import design from file (compile design into ram) =====
::仅适用于纯 v/sv 工程
%Debussy% -sv -f ../file_ver.f
::===== import design from library (compile design into library) =====
::适用于 混合语言工程 和 纯 v/sv 工程
::%vericom% -sv -2001 -f file_ver.f
::%vhdlcom% -2000 -f file_vhd.f
::%Debussy% -lib work -top top &
::删除波形文件
::DEL Debussy.fsdb /q
::删除Debussy生成的相关文件
RD Debussy.exeLog /s /q
DEL novas.rc /q
::退出命令行
EXIT

View File

@@ -0,0 +1,143 @@
#usage : do find_unreferenced_sources.tcl [-d]
# if -d is not specified,only list out the unrefferenced files
# the script does:
# step 1 :generate the report
# step 2 :get all referced files from the report
# step 3 :get all compiled files from the 01_source/01_func directory
# step 4 :compare the two list,find out the unrefferenced ones
# step 5:optionnnaly,delete the unrefferenced files
# step 6: remove the generated reports
proc relative_to_absolute {relative_path} {
#replace all "../" and count how many "../" occured in the original string
set parent_dir_count [regsub -all {\.\.\/} $relative_path "" sufix_path];
set redir_path [pwd];
#cut the current path by N-times to get the common parent path for both "abs" and "rela"
for {set i 0 } {$i < $parent_dir_count} {incr i} {
set last_dir [file tail $redir_path];
regsub /$last_dir $redir_path "" redir_path;
}
set prefix_path $redir_path;
# puts redir_path=$redir_path
set absolute_path $prefix_path/$sufix_path;
return $absolute_path;
}
proc find_files {root_path } {
set results [list];
# lappend results;
#store the current path
set current_path [pwd];
cd $root_path;
set root_path [pwd];
puts "entering $root_path"
# get all files recusively
foreach element [glob -nocomplain * ;] {
# entering sub dirs
if { [file isdirectory $element]} {
set sublist [find_files $element];
set results [concat $results $sublist];
} else {
# only valid source files are filtered
if {[string match "*.v" $element] || [string match "*.sv" $element] || [string match "*.vhd" $element] || [string match "*.vhdl" $element]} {
lappend results "$root_path/$element";
}
}
}
cd $current_path;
puts "++++++++++++++++++++++++++++"
return $results;
}
.main clear
#exit simulation ,unless the change dir will not work
q -sim
puts "---------------------------------ATTENTION----------------------------------------"
puts "----------- this file should be sourced after the vsim load sucessfully-----------"
puts "----------- this file should be sourced from the funcXXX director-----------------"
puts ""
puts ":::::::::get referced dut files:::::::::"
set referenced_files [list ]
set f_report [open $TEMP_REF_FILES r];
#read the report,get all referenced files
while {![eof $f_report]} {
gets $f_report line ;
if { [string match "*Source File*" $line] } {
lappend referenced_files $line;
}
}
close $f_report
#remove those source file,point to precompiled vendor library
#convert the relative path to absolute path
#list referenced_dut_files;
foreach element $referenced_files {
if { [string match "*Source File: \.\./\.\./*" $element] } {
regsub {^.*Source File:} $element "" path;
set relative_path [string trim $path ];
set abs_path [relative_to_absolute $relative_path];
lappend referenced_dut_files $abs_path
# puts $abs_path
}
}
puts ":::::::::get all compiled source files:::::::::"
#get all source files in the source file directory ,recursively
set root_path ../../../01_source/01_func;
set all_sources [find_files $root_path;];
.main clear
puts ":::::::::try to match:::::::::"
#try to match the two lists,and filter the mis-matched ones
#set f_referenced_dut_files [open "referenced.txt" w+];
#foreach sim_file $referenced_dut_files {
# puts $f_referenced_dut_files $sim_file;
#}
#close $f_referenced_dut_files;
#set f_dir_files [open "dir.txt" w+];
#foreach dir_file $all_sources {
# puts $f_dir_files $dir_file;
#}
#close $f_dir_files
puts "found dismated files as follow:"
set mis_matched_dir_files [list]
foreach dir_file $all_sources {
set index [lsearch $referenced_dut_files $dir_file];
if {$index == -1} {
lappend mis_matched_dir_files $dir_file;
puts "path=$dir_file"
}
}
#if specified the -d switch,just delete the files
if {$argc == 1 && [string equal $1 "-d"]} {
puts "the -d switch specified ,delete the dismatched files automatically"
foreach del_file $mis_matched_dir_files {
file delete -force $del_file
}
}
#file delete -force $TEMP_REF_FILES

View File

@@ -0,0 +1,98 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {true} {
# raw script code in pre_format
set pre_format {
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
}
}; list
# from stackoverflow.com "how to keep commands quiet in TCL?"
# if you want to inhibit such printouts in an interactive session(comes in handy from time to time), a simple hack to achieve that is to chain the command
# you want to "silence" with a "silent" command(producing a value whose string representation is an empty string).
# for instance: set a [open "giri.txt" r]; list
if {true} {
# raw script code in post_format
set post_format {
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}
}
}; list
# brace all to eliminate unnecessary output(example. "set fd_pre_savewave [open pre_savewave.tcl r]" will display returned value of set cmd)
if {true} {
# save current wave format to a tmp file
catch {write format wave -window Wave intermediate_wave_format_file.tmp} res
if {$argc>=1} { # example: do savewave.tcl wave_name
set wave_name $1
if {[regexp {^([-\w\+]+\.)+[-\w\+]*$} $wave_name] >= 1} {
# replace the last postfix(.tcl or .do or .) with null, i.e. delete the last postfix(including .)
while {[regexp -nocase {(\.(tcl|do)*$)} $wave_name] >= 1} {
regsub {(\.[-\w\+]*$)} $wave_name {} wave_name
}
} elseif {[regexp {^[-\w\+]+$} $wave_name] >= 1} {
# nop
} else {
echo "Invalid file name $wave_name!"
return
}
set fd_wave [open $wave_name.tcl w]
echo "Wave format saved to $wave_name.tcl"
} else { # example: do savewave.tcl
set fd_wave [open lastwave.tcl w]
echo "Wave format saved to lastwave.tcl"
}
set fd_intermediate_wave_format_file [open intermediate_wave_format_file.tmp r]
# put lines in pre_format to final file(the file specified in argument $1)
set lines [split $pre_format "\n"]
set total_lines [llength $lines]
for {set line_idx 0} {$line_idx < $total_lines} {incr line_idx 1} {
set wave_format_line [lindex $lines $line_idx]
chan puts $fd_wave $wave_format_line
}
# put lines in tmp file to final file(the file specified in argument $1)
while {[chan gets $fd_intermediate_wave_format_file wave_format_line] >= 0} {
if {[regexp -all {\[|\]} $wave_format_line] >= 1} {
# if [ and ] exist in line(like [10:0] or [2]), then escape them, i.e. \[ and \]
regsub -all {\[|\]} $wave_format_line {\\&} wave_format_line
# and then add eval in the biginning
regsub (^) $wave_format_line {eval } wave_format_line
}
# make virtual signal ok
if {[regexp -all {virtual signal} $wave_format_line] >= 1} {
regsub -all {\{} $wave_format_line {[subst &} wave_format_line
regsub -all {\}} $wave_format_line {&]} wave_format_line
}
regsub -all $CASE_NAME $wave_format_line {$CASE_NAME} wave_format_line
chan puts $fd_wave $wave_format_line
}
# put lines in post_format to final file(the file specified in argument $1)
set lines [split $post_format "\n"]
set total_lines [llength $lines]
for {set line_idx 0} {$line_idx < $total_lines} {incr line_idx 1} {
set wave_format_line [lindex $lines $line_idx]
chan puts $fd_wave $wave_format_line
}
close $fd_wave
close $fd_intermediate_wave_format_file
}

View File

@@ -0,0 +1,280 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/read_agent_state
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/agent_en
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mode
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/buf_ready
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/write_ping_n_or_pong
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/buf_ping_ready
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/buf_pong_ready
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/agent_en_d1
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_read_start
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_read_mode
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_read_next_page
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/tmr_cnt
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/page_cnt
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/buf_lo_addr
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_arb_req
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_arb_grant
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_arb_req_end
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_addr
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_wr_req
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_wr_data
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/mram_wr_done
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/fifo_latency_cnt
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_fifo_dq
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_fifo_full
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_fifo_empty
add wave -noupdate -expand -group nand_read_agent /$CASE_NAME/u0_hdtest01_top/inst_nand_read_agent/nand_fifo_rd
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/state_c
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/end_m_write_tmr
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/end_read_page_tmr
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_req
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_type
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_ack
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_done
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/write_done
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/read_req
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/read_type
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/read_ack
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/read_next_page
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_buf_wr
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_buf_waddr
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_buf_wdata
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_buf_re
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_buf_rdata_vld
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/program_buf_rdata
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rd_0
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/write_done
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/read_next_page
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/write_pending
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/is_writing
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/read_pending
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/is_reading
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/wait_mram_mr_f
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/wait_mram_mw_f
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/add_m_r
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_arb_req
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_arb_grant
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_arb_req_end
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_op_addr
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_wr_req
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_wdata
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_wr_done
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_rd_req
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_rdata
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/mram_rd_done
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/cnt_read_page_tmr
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/add_nand_block_1
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/add_nand_block_2
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/add_nand_block_3
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/addr_die
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/addr_block
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/addr_page
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/add_col_r
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rfifo_we
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rfifo_re
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rfifo_data_out
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rfifo_full
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rfifo_empty
add wave -noupdate -group nand_ctrl /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rfifo_q
add wave -noupdate -group arbiter /$CASE_NAME/u0_hdtest01_top/u8_arbiter_wrap/i_req
add wave -noupdate -group arbiter /$CASE_NAME/u0_hdtest01_top/u8_arbiter_wrap/i_req_end
add wave -noupdate -group arbiter /$CASE_NAME/u0_hdtest01_top/u8_arbiter_wrap/o_grant
add wave -noupdate -group marm_cfg /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/u_mram_cfg/state_c
add wave -noupdate -group marm_cfg /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/u_mram_cfg/stat_vld
add wave -noupdate -group marm_cfg /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/u_mram_cfg/status
add wave -noupdate -group marm_cfg /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/u_mram_cfg/init_done
add wave -noupdate -group marm_cfg /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/u_mram_cfg/done
add wave -noupdate -group marm_cfg /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/u_mram_cfg/block_flag
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/state_c
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/rfifo_full
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/ce_n
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/ale_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/ale_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cle_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cle_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/re_n_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/re_n_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/we_n_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/we_n_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cmd_flag
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/dq_en_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/dq_en_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/dq_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/dq_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/ce_n_low
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/ce_n_high
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rd_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rd_1
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rd_2
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_ctrl/rd_3
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/wram_re_reg
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/read_flag
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/write_flag
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/rfifo_data_out
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/dq_out_0
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/program_buf_rdata_vld
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/rfifo_we
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/program_buf_rdata
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cnt_add_byte
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cnt_re_n
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cnt_we_n
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/activate
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/cmd_in
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/add_row
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/add_col
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/status
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/busy
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/stat_vld
add wave -noupdate -group nand_phy /$CASE_NAME/u0_hdtest01_top/inst_nand_top/u_nand_phy/done
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/r_mram_area
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/ARBT_ADC_CS
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_arbt_req
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_arbt_req_end
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/i_arbt_grant
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_user_op_addr
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_user_wr_req
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_user_wr_data
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/i_user_wr_done
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_user_rd_req
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/i_user_rd_data
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/i_user_rd_done
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/r_smp_num
add wave -noupdate -group adc_write /$CASE_NAME/u0_hdtest01_top/u10_adc_arbiter_if_adaptor/o_mram_data_volume
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/r_mram_area
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/NAND_WR_CS
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/ri_mode_code
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/r_axis
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/r_sensor
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_arbt_req
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_arbt_req_end
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/i_arbt_grant
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_mram_rd_addr
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_mram_rd_req
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/i_mram_rd_data
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/i_mram_rd_done
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/r_smp_num
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/i_mram_data_volume
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/i_if_dpram_rd_done
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_if_dpram_wr
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_if_dpram_wr_addr
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_if_dpram_wr_data
add wave -noupdate -group nand_write /$CASE_NAME/u0_hdtest01_top/inst_nand_write_agent/o_if_dpram_wr_done
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/vote_state
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/buf_ready
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/buf_ping_n_or_pong
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/buf_clear
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/buf_type
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/tmr_cnt
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/page_cnt
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/buf_lo_addr
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_arb_req
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_arb_req_end
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_arb_grant
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_addr
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_rd_req
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_rd_data
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/mram_rd_done
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/burst_req
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/trunk_over
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/data
add wave -noupdate -group vote /$CASE_NAME/u0_hdtest01_top/inst_data_tmr_vote/data_vld
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/SCI_CS
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_trunk_id_cnt
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/buf_type
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/buf_ready
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/o_buf_service_request
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/ccsds
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/i_buf_rd_active
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/i_buf_rd_cs
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/i_buf_rd_en
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/i_buf_rd_addr
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/o_buf_rd_data
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/o_buf_rd_data_vld
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/update_tm
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/update_tm_done
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/update_sci
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/update_sci_done
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/i_sci_data
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/i_sci_data_vld
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/o_sci_burst_req
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/o_sci_trunk_over
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_sci_addr_offset
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_sci_frame_cnt
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_wr_din_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_wr_cs_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_wr_r_wn_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_din_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_cs_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_r_wn_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/r_dpram_addr_b
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/chksum
add wave -noupdate -group sci_pkg /$CASE_NAME/u0_hdtest01_top/u99_test_eng_sci_data_pkg/sensor_id
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/CS
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_bank_ce_n
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_bank_oe_n
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_bank_we_n
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_bank_addr
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/io_bank_data
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/i_user_op_addr
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/i_user_wr_req
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/i_user_wr_data
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_user_wr_done
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/i_user_rd_req
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_user_rd_data
add wave -noupdate -group mram_driver /$CASE_NAME/u0_hdtest01_top/u9_mram_driver/o_user_rd_done
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/DIST_CS
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/i_1553_int_n
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/i_buf_service_request
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/w_buf_service_request
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/vector_word
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/o_user_msg_mem_reg_n
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/r_1553_int_n_neg
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/o_user_msg_op_addr
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/o_user_msg_wr_req
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/o_user_msg_wr_data
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/i_user_msg_wr_done
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/o_user_msg_rd_req
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/i_user_msg_rd_data
add wave -noupdate -expand -group msg_dist /$CASE_NAME/u0_hdtest01_top/u1_bu65170_driver_top/u05_bu65170_msg_dist/i_user_msg_rd_done
eval TreeUpdate \[SetDefaultTree\]
WaveRestoreCursors {{Cursor 1} {703840517004 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 248
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {1575 ms}
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/uart_rx
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/uart_tx
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_buf
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/exec_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/m_axil_bvalid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/m_axil_rvalid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/m_axil_rdata
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/m_axil_arvalid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/timeout
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/ehex
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/ehex_valid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/ehex_ready
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/errno
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cli_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cmd_abort
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cmd_abort_ack
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cmd_abort_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_ctrlc
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_ctrlc_ack
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_ctrlc_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_enter
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_enter_ack
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_enter_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_prompt_ack
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_prompt_pending
eval TreeUpdate \[SetDefaultTree\]
WaveRestoreCursors {{Cursor 1} {26778052000 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 335
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {26777923837 ps} {26778164163 ps}
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}

View File

@@ -0,0 +1,227 @@
#quit -sim
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#unbound the the "work" lib dir from vsim,to remove it
#when error do not save wave list
if {![string compare [runStatus] "ready" ] || ![string compare [runStatus] "break" ]} {
source savewave.tcl
}
#catch {q -sim} res
#dataset close -all
echo on
.main clear
puts "+++++++++++++++++++++++++++++++++++++++$CASE_NAME start+++++++++++++++++++++++++++++++++++++++"
vmap std $SIM_TOOL_PATH/std ;
vmap ieee $SIM_TOOL_PATH/ieee ;
set FUNC_SOURCE_DIR ../../../01_source/01_func
set TIMING_SOURCE_DIR ../../../01_source/02_timing
set source_vhdl false
set source_verilog false
set LIB_OPTION ""
set LOG_OPTION ""
#if {[string match -nocase {libero*} $FPGA_KIT_VER]} {
# #-----------actel----------
# #puts "IDE IS $FPGA_KIT_VER!"
# foreach file [glob -nocomplain -directory $FUNC_SOURCE_DIR *.vhd] {
# set LOG_OPTION "-vhdlvariablelogging"
# }
# if {[string equal -nocase vhd $TOP_FILE_LANG]} {
# vmap ${ACTEL_FAMILY} $VHDL_LIB/${ACTEL_FAMILY};
# } else {
# vmap ${ACTEL_FAMILY} $VLOG_LIB/${ACTEL_FAMILY};
# }
# set LIB_OPTION "-L ${ACTEL_FAMILY}"
#
#} elseif {[string match -nocase {ise*} $FPGA_KIT_VER]} {
# #puts "IDE IS $FPGA_KIT_VER!"
# foreach file [glob -nocomplain -directory $FUNC_SOURCE_DIR *.vhd] {
# set source_vhdl true
# set LOG_OPTION "-vhdlvariablelogging"
# }
# foreach file [glob -nocomplain -directory $FUNC_SOURCE_DIR *.v] {
# set source_verilog true
# }
# if { [string equal -nocase true $source_vhdl] } {
# #-----------xilinx vhdl----------
# #puts "vhdl file exist!"
# vmap simprim $VHDL_LIB/simprim
# vmap unisim $VHDL_LIB/unisim
# vmap xilinxcorelib $VHDL_LIB/xilinxcorelib
# vmap unimacro $VHDL_LIB/unimacro
# set LIB_OPTION "-L simprim -L unisim -L xilinxcorelib -L unimacro"
# }
#
# if { [string equal -nocase true $source_verilog] } {
# #-----------xilinx verilog----------
# #puts "verilog file exist!"
# vmap unisims_ver $VLOG_LIB/unisims_ver
# vmap simprims_ver $VLOG_LIB/simprims_ver
# vmap xilinxcorelib_ver $VLOG_LIB/xilinxcorelib_ver
# vmap unimacro_ver $VLOG_LIB/unimacro_ver
# vmap secureip $VLOG_LIB/secureip
# set LIB_OPTION "-L unisims_ver -L simprims_ver -L xilinxcorelib_ver -L unimacro_ver -L secureip"
# }
#}
set defs [dict create;] ;
dict append defs CASE_NAME $CASE_NAME;
dict append defs TOP_ENTITY $TOP_ENTITY;
dict append defs TOP_INSTANCE $TOP_INSTANCE;
dict append defs timing;
dict append defs SIM_TIME $SIM_TIME ;
set def_string "";
dict for {def_name def_value} $defs {
set def_string [format "%s+define+%s=%s" $def_string $def_name $def_value;];
}
puts "the define string is:$def_string"
#file delete -force work ;
vlib $WORK_LIB_DIR/${CASE_DIR};
vmap work $WORK_LIB_DIR/${CASE_DIR};
catch { file delete -force $WORK_LIB_DIR/${CASE_DIR}/_lock } res;
catch {file delete -force $WORK_LIB_DIR/${CASE_DIR}/ } res;
#if {![info exists SIM_TYPE]} {set SIM_TYPE func}
#if {![info exists CORNER_TYPE]} {set CORNER_TYPE 03_max}
#if {[info exists 1]} {
# set SIM_TIME $1
#} elseif {![info exists SIM_TIME]} {set SIM_TIME -all}
#by default,all cases use the same source file list
set VLOG_SOURCE_LIST ../file_ver.f;
set VHDL_SOURCE_LIST ../file_vhd.f;
#we specify individual file list for single case
if {[file exists file_ver.f ]} {
puts "---->using case dependent verilog file list"
set VLOG_SOURCE_LIST file_ver.f;
}
if {[file exists file_vhd.f ]} {
puts "---->using case dependent vhdl file list"
set VHDL_SOURCE_LIST file_vhd.f;
}
if {![string equal vhd $TOP_FILE_LANG]} {
set GLBL glbl
}
if {$SIM_TYPE == "timing"} {
set SDF_TYPE "-sdfmax";
set SDFCOM_TYPE "-maxdelays";
puts "*************************timing simulation for CORNER_TYPE= $CORNER_TYPE*************************"
if {[string equal $CORNER_TYPE "01_min" ]} {
set SDF_TYPE "-sdfmin";
set SDFCOM_TYPE "-mindelays";
puts "++++++++++ set SDF_TYPE = -sdfmin ++++++++++";
} elseif {[string equal $CORNER_TYPE "02_type" ]} {
set SDF_TYPE "-sdftyp";
set SDFCOM_TYPE "-typdelays";
puts "++++++++++ set SDF_TYPE = -sdftyp ++++++++++";
} elseif {[string equal $CORNER_TYPE "03_max" ]} {
set SDF_TYPE "-sdfmax";
set SDFCOM_TYPE "-maxdelays";
puts "++++++++++ set SDF_TYPE = -sdfmax ++++++++++";
}
if {[string match -nocase "libero*" $FPGA_KIT_VER]} {
puts "++++++++++ develop kit is libero ++++++++++";
} else {
puts "++++++++++ develop kit is not libero ++++++++++";
set TIMING_SOURCE_DIR ${TIMING_SOURCE_DIR}/${CORNER_TYPE}
}
sdfcom $SDFCOM_TYPE $TIMING_SOURCE_DIR/${TOP_ENTITY}.sdf $TIMING_SOURCE_DIR/${TOP_ENTITY}.sdfcom
#in timing simulation ,here only glbl may be compiled seperately
if {[file exists ${VLOG_SOURCE_LIST}]} {
vlog -incr -quiet -sv +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string
}
vlog -quiet +cover=${COVERAGE_OPTION} -work work ${TIMING_SOURCE_DIR}/*.v
vlog -quiet -sv +cover=${COVERAGE_OPTION} -work work tb.sv $def_string
eval vopt ${GLBL} ${CASE_NAME} +acc=npr ${LIB_OPTION} -o ${CASE_NAME}_opt \
+initmem+0 +initreg+0 +initwire+0;
eval vsim -batch -quiet ${LIB_OPTION} -t 100ps -wlfopt -wlfcompress -nostdout \
+no_notifier +no_tchk_msg\
work.${CASE_NAME}_opt -wlf ${WAVE_OUTPUT_DIR}/${CASE_NAME}_timing.wlf +notimingchecks \
${SDF_TYPE} ${CASE_NAME}/${TOP_INSTANCE}=${TIMING_SOURCE_DIR}/${TOP_ENTITY}.sdfcom;
do ../suppresswarning.tcl
catch {run ${SIM_TIME} } res
} else {
#compile source files
if {[file exists ${VLOG_SOURCE_LIST}]} {
puts "---->compile verilog source files ,testbench and models using $VLOG_SOURCE_LIST........"
# vlog -incr -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003
vlog -sv -vmake -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003
}
if {[file exists ${VHDL_SOURCE_LIST}]} {
puts "---->compile vhdl files using $VHDL_SOURCE_LIST........"
vcom -vmake -nocoverudp -2008 -explicit -quiet +cover=${COVERAGE_OPTION} -work work -f ${VHDL_SOURCE_LIST}
}
# eval vopt ${GLBL} ${CASE_NAME} +acc -o ${CASE_NAME}_opt ${LIB_OPTION} \
# +cover=bcsf+/${CASE_NAME}/${TOP_INSTANCE} -nocoverudp -nocovercells \
# +initmem+0 +initreg+0 +initwire+0 \
# -suppress 2912 \
# -suppress 1127
#to mask 211 error
catch {
if { [string compare [runStatus] "ready" ] && [string compare [runStatus] "break" ]} {
eval vsim ${LOG_OPTION} -batch -quiet -coverage -voptargs="+acc=npr" ${LIB_OPTION} \
-t 1ps -wlfopt -wlfcompress -nostdout \
+initmem+0 +initreg+0 +initwire+0 \
+no_notifier +no_tchk_msg -suppress 3009 -suppress 12110 \
-classdebug \
glbl work.${CASE_NAME} \
-wlf ${WAVE_OUTPUT_DIR}/${CASE_DIR}_timeing.wlf
} else {
restart -f
}
} res;
do ../suppresswarning.tcl
catch {do wave.tcl} res
set TEMP_REF_FILES info.txt;
write report -l $TEMP_REF_FILES
catch {run ${SIM_TIME} } res
do ../saveucdb.tcl
#}
set current_path [pwd]
puts "+++++++++++++++++++++++++++current path=$current_path++++++++++++++++++++++++++++++++"

View File

@@ -0,0 +1,20 @@
quit -sim
cd ..
#clear the simulator transcript window and make the wave,data & coverage director
.main clear
set wrap_args [list];
#put the do command $1-$9 to list,because we can't use the argv,we should construct the "argv" mannully.
for {set i 1} {$i <= $argc} {incr i 1} {
lappend wrap_args [set $i];
}
#echo $args
eval do runone.tcl $wrap_args

View File

@@ -0,0 +1,7 @@
if {$argc>=1} {
catch {write format wave -window Wave $1.tcl} res
} else {
catch {write format wave -window Wave case.tcl} res
}

View File

@@ -0,0 +1,114 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {true} {
# raw script code in pre_format
set pre_format {
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
}
}; list
# from stackoverflow.com "how to keep commands quiet in TCL?"
# if you want to inhibit such printouts in an interactive session(comes in handy from time to time), a simple hack to achieve that is to chain the command
# you want to "silence" with a "silent" command(producing a value whose string representation is an empty string).
# for instance: set a [open "giri.txt" r]; list
if {true} {
# raw script code in post_format
set post_format {
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}
}
}; list
# support save format when only open .wlf instead of run a case
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
# brace all to eliminate unnecessary output(example. "set fd_pre_savewave [open pre_savewave.tcl r]" will display returned value of set cmd)
if {true} {
# save current wave format to a tmp file
catch {write format wave -window Wave intermediate_wave_format_file.tmp} res
if {$argc>=1} { # example: do savewave.tcl wave_name
set wave_name $1
if {[regexp {^([-\w\+]+\.)+[-\w\+]*$} $wave_name] >= 1} {
# replace the last postfix(.tcl or .do or .) with null, i.e. delete the last postfix(including .)
while {[regexp -nocase {(\.(tcl|do)*$)} $wave_name] >= 1} {
regsub {(\.[-\w\+]*$)} $wave_name {} wave_name
}
} elseif {[regexp {^[-\w\+]+$} $wave_name] >= 1} {
# nop
} else {
echo "Invalid file name $wave_name!"
return
}
set fd_wave [open $wave_name.tcl w]
echo "Wave format saved to $wave_name.tcl"
} else { # example: do savewave.tcl
set fd_wave [open wave1.tcl w]
echo "Wave format saved to wave1.tcl"
}
set fd_intermediate_wave_format_file [open intermediate_wave_format_file.tmp r]
# put lines in pre_format to final file(the file specified in argument $1)
set lines [split $pre_format "\n"]
set total_lines [llength $lines]
for {set line_idx 0} {$line_idx < $total_lines} {incr line_idx 1} {
set wave_format_line [lindex $lines $line_idx]
chan puts $fd_wave $wave_format_line
}
# put lines in tmp file to final file(the file specified in argument $1)
while {[chan gets $fd_intermediate_wave_format_file wave_format_line] >= 0} {
if {[regexp -all {\[|\]} $wave_format_line] >= 1} {
# if [ and ] exist in line(like [10:0] or [2]), then escape them, i.e. \[ and \]
regsub -all {\[|\]} $wave_format_line {\\&} wave_format_line
# and then add eval in the biginning
regsub (^) $wave_format_line {eval } wave_format_line
}
# make virtual signal ok
if {[regexp -all {virtual signal} $wave_format_line] >= 1} {
regsub -all {\{} $wave_format_line {[subst &} wave_format_line
regsub -all {\}} $wave_format_line {&]} wave_format_line
}
regsub -all $CASE_NAME $wave_format_line {$CASE_NAME} wave_format_line
chan puts $fd_wave $wave_format_line
}
# put lines in post_format to final file(the file specified in argument $1)
set lines [split $post_format "\n"]
set total_lines [llength $lines]
for {set line_idx 0} {$line_idx < $total_lines} {incr line_idx 1} {
set wave_format_line [lindex $lines $line_idx]
chan puts $fd_wave $wave_format_line
}
close $fd_wave
close $fd_intermediate_wave_format_file
}

View File

@@ -0,0 +1,71 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/rx_valid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/rx_data
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/rx_ready
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/tx_valid
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/tx_data
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/tx_ready
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/status
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cli_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/exec_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_state
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_data
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_status
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_status_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cli_wdata
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_buf
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_char
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cli_push_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/char_cnt
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/strlen
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/word_cnt
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_mem
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cmd_read
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cmd_read_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/cmd_write
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_enter
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_enter_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_enter_ack
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_prompt_pending
add wave -noupdate /$CASE_NAME/u0_uart_cli_axil/u0_cli2axil/echo_prompt_ack
eval TreeUpdate \[SetDefaultTree\]
WaveRestoreCursors {{Cursor 1} {3951644000 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 348
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {3951483782 ps} {3951804218 ps}
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}

View File

@@ -0,0 +1,113 @@
`timescale 1ns/1ps
module
`CASE_NAME();
`include "../instantiate_top.sv"
final mti_fli::mti_Cmd("do ../saveucdb.tcl");
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>simulation time control>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*to end the simulation commandary*/
/*if you want to end the simulation case by case,just comment the line
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<simulation time control<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
//TODO:
// instance vip
vip_clock # (.FREQUENCY_MHZ(125)) u0_clock(.duty_percent(50), .jitter_percent(0), .clk(clk));
initial begin
enable = 1'b1;
max_resp_time = 8'h1;
tvalid = 0;
tdata = 0;
tkeep = 0;
tstrb = 0;
tlast = 0;
rst_n = 0;
#1us rst_n = 1;
end
task send_stream(input int number_of_beats, input int beat_cycle = 8, input logic last_beat_valid = 1);
begin
repeat(number_of_beats-last_beat_valid) begin
@(posedge clk);
tvalid = 1'b1;
tdata = $urandom;
tkeep = 1'b1;
tstrb = 1'b1;
tlast = 1'b0;
repeat(beat_cycle-1) begin
@(posedge clk);
tvalid = 0;
tdata = 0;
tkeep = 0;
tstrb = 0;
tlast = 0;
end
end
if (last_beat_valid) begin
@(posedge clk);
tvalid = 1'b1;
tdata = $urandom;
tkeep = 1'b1;
tstrb = 1'b1;
tlast = 1'b1;
repeat(beat_cycle-1) begin
@(posedge clk);
tvalid = 0;
tdata = 0;
tkeep = 0;
tstrb = 0;
tlast = 0;
end
end else begin
@(posedge clk);
tvalid = 1;
tdata = 0;
tkeep = 0;
tstrb = 0;
tlast = 1;
repeat(beat_cycle-1) begin
@(posedge clk);
tvalid = 0;
tdata = 0;
tkeep = 0;
tstrb = 0;
tlast = 0;
end
end
@(posedge clk);
tvalid = 0;
tdata = 0;
tkeep = 0;
tstrb = 0;
tlast = 0;
end
endtask
initial begin
#1ns;
@(posedge rst_n);
#10us;
send_stream(16);
#50us;
send_stream(20);
#100us;
send_stream(8);
#1ms;
send_stream(800);
#10us;
send_stream(300);
end
endmodule

View File

@@ -0,0 +1,29 @@
module vip_clock
#(
parameter FREQUENCY_MHZ = 1,
parameter PHASE_DEGREE = 0
)
(
input int duty_percent = 50,//dynamical parameter
input int jitter_percent = 0,//dynamical parameter
output clk
);
logic ideal_clk;
initial begin
ideal_clk = 0;
#(1.0e3/FREQUENCY_MHZ/360.0*PHASE_DEGREE * 1ns);
forever begin
ideal_clk = 0;
#(1.0e3/FREQUENCY_MHZ*(1-duty_percent/100.0)* 1ns);
ideal_clk = 1;
#(1.0e3/FREQUENCY_MHZ*duty_percent/100.0 * 1ns);
end
end
assign # (1.0e3/FREQUENCY_MHZ*jitter_percent/100.0*1ns) clk = ideal_clk;
endmodule

View File

@@ -0,0 +1,215 @@
`ifndef _VIP_UART_SV_
`define _VIP_UART_SV_
module vip_uart
(
input logic rx,
output logic tx
);
parameter CAPTURE = "none"; // "none": no capture, "hex": hex capture, "raw": raw capture(ascii)
parameter DW = 8;
parameter BAUD_RATE = 115200;
parameter CHK_MODE = "none";
parameter STOP_BITS = 1.0;
parameter BAUD_ERROR = 0.0;
parameter SAMPLES = 32;
parameter SAMPLE_TH = $floor(SAMPLES*0.9);
parameter IDLE_BYTES_MS = 0;
parameter RX_BIT_WIDTH_NS = 1.0/(BAUD_RATE) * 1e9;//receiption do not take baud rate skew into account
parameter TX_BIT_WIDTH_NS = 1.0/(BAUD_RATE * (1 - BAUD_ERROR)) * 1e9;//transmit takes baud rate skew into account
parameter TX_STOP_WIDTH_NS = STOP_BITS * TX_BIT_WIDTH_NS;
parameter RX_SAMPLE_WIDTH_NS = RX_BIT_WIDTH_NS/SAMPLES;
parameter integer STOP_BIT_SAMPLES = $ceil(STOP_BITS*SAMPLES);
logic rx_clk;
logic [SAMPLES-1:0] rx_sample_bits;
logic [STOP_BIT_SAMPLES-1:0] rx_sample_stop_bits;
logic [DW-1:0]rx_data;//valid while rx_valid =1
logic rx_valid;//asserted when a new word receiption has just completed,deasserted when new receiption starts,
logic parity_error;//asserted when a parity error has been detected,deasserted when new receiption starts
logic stop_error;//asserted when a stop error has been detected,deasserted when new receiption starts
initial begin
tx = 1;
rx_valid = 0;
parity_error = 0;
stop_error = 0;
end
initial begin
integer log_file;
string full_path;
string instance_name;
int last_dot_pos;
// Get the full hierarchical path into a string
full_path = $sformatf("%m");
instance_name = full_path;
if (CAPTURE != "none") begin
log_file = $fopen({instance_name,"_capture.log"},"w");
if(log_file == 0) begin
$error("Failed to open log file for writing.");
end
end
if (CAPTURE == "hex") begin
$fwrite(log_file,"# %s hex capture log:\n",instance_name);
forever begin
repeat(16) begin
@(posedge rx_valid);
$fwrite(log_file,"%02x ",rx_data);
$fwrite(log_file,"\n");
end
end
end else if (CAPTURE == "raw") begin
$fwrite(log_file,"// %s raw capture log:\n",instance_name);
forever @(posedge rx_valid) begin
$fwrite(log_file,"%c",rx_data);
end
end
end
task automatic send(logic [DW-1:0] data);
tx = 0;
#(TX_BIT_WIDTH_NS*1ns);
for(int i = 0;i < DW;i++) begin
tx = data[i];
#(TX_BIT_WIDTH_NS*1ns);
end
case (CHK_MODE)
"odd":begin
tx = (^data) ^ 1;
#(TX_BIT_WIDTH_NS*1ns);
end
"even":begin
tx = (^data) ^ 0;
#(TX_BIT_WIDTH_NS*1ns);
end
endcase
tx = 1;
#(TX_STOP_WIDTH_NS*1ns);
#(IDLE_BYTES_MS*1ms);
endtask
initial begin
rx_clk = 0;
forever begin
rx_clk =#(RX_BIT_WIDTH_NS/SAMPLES/2*1ns) ~rx_clk;//generate 32x clk for receive
end
end
function automatic logic vote(logic [SAMPLES-1:0] data,int th);
int count_ones = 0;
logic [SAMPLES-1:0] mask;
int i = 0;
do begin
i++;
end while(data[i] == 0 && i < SAMPLES);//jump over contineous zeros
do begin
i++;
end while(data[i] == 1 && i < SAMPLES);//jump over contineous ones
mask = ~(2**i-1);
if(i < SAMPLES && (data & mask != 0)) begin//the remaining should be all zeros
$warning("samples=%b,glitch occured",data);
end
foreach(data[i]) begin
count_ones = data[i] ? (count_ones + 1) : count_ones;//only logic high is weighted
end
if(count_ones >= th) begin//find the majority by threshold
return 1;
end else begin
return 0;
end;
endfunction
initial begin
forever begin
receive();
end
end
task automatic receive();
logic stop_bit;
logic calc_parity;
logic parity_bit;
logic rx_bit;
@(negedge rx);
rx_valid = 0;
parity_error = 0;
stop_error = 0;
sample_one_bit(rx_bit);
if(rx_bit == 0) begin
for(int i = 0;i<DW;i++)begin
sample_one_bit(rx_data[i]);
end
case (CHK_MODE)
"odd","even":begin
sample_one_bit(parity_bit);
end
endcase
do_sample(STOP_BIT_SAMPLES, rx_sample_stop_bits);
stop_bit = vote(rx_sample_stop_bits,STOP_BIT_SAMPLES*0.9);
calc_parity = (^rx_data) ^ parity_bit;
case (CHK_MODE)
"odd":begin
if(calc_parity != 1) begin
$warning("%s parity error,data=%08b,parity=%01b",CHK_MODE,rx_data,parity_bit);
parity_error = 1;
end
end
"even":begin
if(calc_parity != 0) begin
$warning("%s parity error,data=%08b,parity=%01b",CHK_MODE,rx_data,parity_bit);
parity_error = 1;
end
end
endcase
if(stop_bit != 1) begin
$warning("stop error,stop=%f,samples = %b",STOP_BITS,rx_sample_bits);
stop_error = 1;
end
rx_valid = 1;
end else begin
$display("searching start bit...,samples = %b",rx_sample_bits);
end
endtask
task automatic sample_one_bit(output logic rx_bit);
do_sample(SAMPLES, rx_sample_bits);
rx_bit = vote(rx_sample_bits, SAMPLE_TH);
endtask
task automatic do_sample(input int xpoints, output logic [(STOP_BIT_SAMPLES > SAMPLES ? STOP_BIT_SAMPLES : SAMPLES)-1:0] rx_vec);
rx_vec = 0;
#((RX_SAMPLE_WIDTH_NS/2.0)*1ns);
rx_vec[0] = rx;
for(int i = 1;i<xpoints;i++) begin
#(RX_SAMPLE_WIDTH_NS*1ns);
rx_vec[i] = rx;
end
#((RX_SAMPLE_WIDTH_NS/2.0)*1ns);
endtask
endmodule
`endif

View File

@@ -0,0 +1,75 @@
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#preset envieroment variables
if {[info exists SIM_TYPE] && $SIM_TYPE == "timing"} {
} else {
puts "---->checing the simulator status to decide whether to restore the wave session.................."
puts "---->the runstatus is :[runStatus]"
#if {![string compare [runStatus] "ready" ] || ![string compare [runStatus] "error" ]} {
puts "---->trying restore to saved wave window.................."
catch {
set size [file size lastwave.tcl];
#check if size is too much
if($size > (10*1024){
puts "lastwave.tcl size is $size,try to recover"
do lastwave.tcl
}
} res;
#}
# catch {log -mvcreccomplete -r -depth 6 /* } res
catch {log -mvcreccomplete -r -depth 6 /$CASE_NAME/*} res
catch {log -mvcreccomplete -r -depth 6 /$CASE_NAME/$TOP_INSTANCE/*} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/CENTRAL_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/TIME_TICK_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGRX_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGRX_inst/TRAIN_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGRX_inst/SEQUENCER_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGRX_inst/GENIMGVAL_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGRXDATA_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_TOP_instHigh} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_TOP_instHigh/SDRAM_AREF_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_TOP_instHigh/SDRAM_INIT_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_TOP_instHigh/SDRAM_READ_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_TOP_instHigh/SDRAM_WRITE_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_TOP_instLow} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/SDRAM_FRMRDCTRL_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGTX_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/IMGSPI_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/COMMANDHANDLER_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/ERUPRAMCAL_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/ERUPSUM_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/FRMHEADWR_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/GUIDEPIEZORX_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/STATE_RETURN_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/TEMP461_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/TIME_TICK_inst} res
# catch {log -mvcreccomplete -r -depth 4 /$CASE_NAME/$TOP_INSTANCE/TIMEPRO_inst} res
# log -class pkg_uart::uart
# catch {class/pkg_uart::uart::uart__2} res;
}

View File

@@ -0,0 +1,69 @@
# When open .wlf file, there is no CASE_NAME variable in context. We get the case name by searching in the struct window instead.
if {![info exists CASE_NAME]} {
puts "++++++++++ search case name ++++++++++"
set wave_sim_type func
for {set wave_i 0} {$wave_i < 1000} {incr wave_i 1} {
set wave_case_num [format "%03d" $wave_i];
set wave_case_name ${wave_sim_type}${wave_case_num}
if {[search structure $wave_case_name] >= 0} {
break
}
}
set unset_CASE_NAME true
set CASE_NAME $wave_case_name
}
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/clk
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/rst_n
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/enable
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/max_resp_time
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/tdata
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/tkeep
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/tlast
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/tstrb
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/tvalid
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/tready
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/buf_addr
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/buf_wea
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/buf_wdata
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/counter_rx_beats
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/counter_rx_bursts
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/counter_rx_segments
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/buf_status
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/list_addr
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/list_wea
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/list_wdata
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/list_rdata
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/segment_done
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/buf_addr_next
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/timeout
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/timer_enable
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/rx_state
add wave -noupdate /$CASE_NAME/u0_stream_rx_if/raise_bot_half
eval TreeUpdate \[SetDefaultTree\]
WaveRestoreCursors {{Cursor 1} {1250932287 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 290
configure wave -valuecolwidth 94
configure wave -justifyvalue left
configure wave -signalnamewidth 0
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {0 ps} {2100 us}
if { [info exists unset_CASE_NAME] && [string equal -nocase true $unset_CASE_NAME] } {
set unset_CASE_NAME false
unset CASE_NAME
}

View File

@@ -0,0 +1,39 @@
#usage: "do xxx.tcl timing" for timing simulation and "do xxx.tcl" for functional simulation
#get the current script file name by [info frame],walk through all frame return lines
#here we use the "do ..." command to start this script,so we can't use the [info script]
#command to start this script
#with the "do ..." command,we can start this script with command line options,and we
#can refercen these options by $1,$2,etc.
proc get_file_name { } {
set file_name 0
catch {
set max_info [info frame]
puts "maxinfo=$max_info"
puts "...................................."
for {set a $max_info} {$a>0} {incr a -1} {
puts $a
set framestring [info frame $a];
puts $framestring;
set cmdstring [dict get $framestring cmd]; #extract command with "cmd" key
if {[string match *case*.tcl* $cmdstring]} { #search "do xxx.tcl timing" patten
puts $cmdstring
set ary [split $cmdstring " "]
puts $ary
set file_name [lindex $ary 1]
puts $file_name
break
}
}
}
return $file_name
}
proc get_case_num {case_name} {
regsub {[a-z]*} $case_name {} case_num
# puts $case_num
return $case_num
}

66
stream_rx_ctrl/sim/glbl.v Normal file
View File

@@ -0,0 +1,66 @@
// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.15 2011/08/25 22:54:30 fphillip Exp $
`timescale 1 ps / 1 ps
module glbl ();
parameter ROC_WIDTH = 100000;
parameter TOC_WIDTH = 0;
//-------- STARTUP Globals --------------
wire GSR;
wire GTS;
wire GWE;
wire PRLD;
tri1 p_up_tmp;
tri (weak1, strong0) PLL_LOCKG = p_up_tmp;
wire PROGB_GLBL;
wire CCLKO_GLBL;
reg GSR_int;
reg GTS_int;
reg PRLD_int;
//-------- JTAG Globals --------------
wire JTAG_TDO_GLBL;
wire JTAG_TCK_GLBL;
wire JTAG_TDI_GLBL;
wire JTAG_TMS_GLBL;
wire JTAG_TRST_GLBL;
reg JTAG_CAPTURE_GLBL;
reg JTAG_RESET_GLBL;
reg JTAG_SHIFT_GLBL;
reg JTAG_UPDATE_GLBL;
reg JTAG_RUNTEST_GLBL;
reg JTAG_SEL1_GLBL = 0;
reg JTAG_SEL2_GLBL = 0 ;
reg JTAG_SEL3_GLBL = 0;
reg JTAG_SEL4_GLBL = 0;
reg JTAG_USER_TDO1_GLBL = 1'bz;
reg JTAG_USER_TDO2_GLBL = 1'bz;
reg JTAG_USER_TDO3_GLBL = 1'bz;
reg JTAG_USER_TDO4_GLBL = 1'bz;
assign (weak1, weak0) GSR = GSR_int;
assign (weak1, weak0) GTS = GTS_int;
assign (weak1, weak0) PRLD = PRLD_int;
initial begin
GSR_int = 1'b1;
PRLD_int = 1'b1;
#(ROC_WIDTH)
GSR_int = 1'b0;
PRLD_int = 1'b0;
end
initial begin
GTS_int = 1'b1;
#(TOC_WIDTH)
GTS_int = 1'b0;
end
endmodule

View File

@@ -0,0 +1,56 @@
#TODO:set the top module name with extention
set TOP_FILE stream_rx_if.sv
#TODO:set the top entity architecuture,vhdl file only;If the top module file is verilog,just ignore this var
set TOP_VHD_ARCH Behavioral
#TODO:set the coverage collect option
set COVERAGE_OPTION sbfce
#TODO:set the root path of simlation library,relative to the run.tcl
set SIM_LIB_ROOT ../../../../../../03_simlib
#set SIM_LIB_ROOT d:/02_work/simlib
#TODO:sset the simulator excutable path
set SIM_TOOL_PATH c:/questasim64_10.7
#TODO: device family, microsemi/actel only
set ACTEL_FAMILY proasic3l
#TODO:set simulator name
set SIMULATOR questasim
#TODO:set simulator verion
set SIMULATOR_VER 10.7
#TODO:set simulator platform
set SIMULATOR_PLATFORM nt64
#TODO:set fpga par tools
set FPGA_KIT_VER libero11.8
#TODO:set vhdl library full path
#set VHDL_LIB $SIM_LIB_ROOT/vhdl/$SIMULATOR/$SIMULATOR_VER/$SIMULATOR_PLATFORM/$FPGA_KIT_VER
#TODO:set verilog library full pth
#set VLOG_LIB $SIM_LIB_ROOT/verilog/$SIMULATOR/$SIMULATOR_VER/$SIMULATOR_PLATFORM/$FPGA_KIT_VER
file mkdir coverage
file mkdir wave
file mkdir data
file mkdir work
#DO NOT MODIFYset the coverage data dirctory,relative to the run.tcl
set COVERAGE_OUTPUT_DIR ../coverage
#DO NOT MODIFYset the wave data dirctory,relative to the run.tcl
set WAVE_OUTPUT_DIR ../wave
#DO NOT MODIFYset the wave data dirctory,relative to the run.tcl
set WORK_LIB_DIR ../work
#DO NOT MODIFYget the top most module name
set TOP_ENTITY [file rootname ${TOP_FILE}]
#DO NOT MODIFYget the top most module language,vhdl or verilog
set TOP_FILE_LANG [file extension ${TOP_FILE}]
#DO NOT MODIFYse the top most instance name,with "u0_" prefix
set TOP_INSTANCE u0_${TOP_ENTITY}

View File

@@ -0,0 +1,48 @@
/*>>>>>>>>>>>>>>>>>>>>>>>THIS FILE IS GENERERATED BY ROBOT >>>>>>>>>>>>>>>>>>>*/
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>port declaration>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*add all port here*/
/*use "logic" to replace "logic" and "logic" ports*/
/*use "wire" to replace "inout" ports*/
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<port declaration<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
//TODO:
parameter STREAM_WIDTH = 8;
parameter BUF_SIZE = 4096; // in bytes
parameter SEG_SIZE = 256; // in bytes
logic clk;
logic rst_n;
logic enable;
logic [7:0] max_resp_time; // ms
logic [31:0] buf_status;
logic [31:0] counter_rx_beats;
logic [31:0] counter_rx_bursts;
logic [31:0] counter_rx_segments;
logic [STREAM_WIDTH-1:0] tdata;
logic tvalid;
logic tlast;
logic [STREAM_WIDTH/8-1:0] tkeep;
logic [STREAM_WIDTH/8-1:0] tstrb;
logic tready;
logic buf_clk;
logic [$clog2(BUF_SIZE)-1:0] buf_addr;
logic [STREAM_WIDTH/8-1:0] buf_wea;
logic [STREAM_WIDTH-1:0] buf_wdata;
logic [STREAM_WIDTH-1:0] buf_rdata;
logic list_clk;
logic [11:0] list_addr;
logic [ 3:0] list_wea;
logic [31:0] list_wdata;
logic [31:0] list_rdata;
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>logic ports intialization>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*initialize all "logic" ports here
/*all inputs default as 0;modify if necessary
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<logic ports intialization<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
//TODO:
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>instantiate top most module>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<instantiate top most module<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
/*do not modify
*/
`TOP_ENTITY `TOP_INSTANCE(.*);

View File

@@ -0,0 +1,16 @@
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
source globalset.tcl
if {[info exists TOP_FILE_LANG] && ![string compare ${TOP_FILE_LANG} ".vhd"]} {
vcover merge -stats=none -strip 0 -du [string tolower ${TOP_ENTITY}]([string tolower ${TOP_VHD_ARCH}]) -recursive -totals merge.ucdb ./coverage/*.ucdb
} else {
vcover merge -stats=none -strip 0 -du ${TOP_ENTITY} -recursive -totals merge.ucdb ./coverage/*.ucdb
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,147 @@
set SIM_TYPE func ;
set CASE_NUM 1 ;
set SIM_TIME 100sec ;#as all
set CORNER_TYPE max ;
set COPY_RUN_TEMPLATE no;
#declear a empty list
set args [list];
#put the do command $1-$9 to list,because we can't use the argv,we should construct the "argv" mannully.
for {set i 1} {$i <= $argc} {incr i 1} {
lappend args [set $i];
}
puts "---->parsing the command line....argc=$argc,args=$args*************************"
#get the max index of the list,the "expr" command should be use to calculate out the express
set max_index [expr $argc-1];
#search copy templation option
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i]
if {[string equal $para "-c"]} {
set COPY_RUN_TEMPLATE yes
puts "whether to copy run.tcl template=$COPY_RUN_TEMPLATE"
break;
}
}
#search generate instantiate_top.sv opton
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i]
if {[string equal $para "-g"]} {
set GEN_INSTANTIATE_TOP yes
puts "force generate instantiate_top.sv and override exist file"
break;
}
}
#search case number
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i];
if {[string equal $para "-n"] } {
if {$i < $max_index} {
set num [lindex $args [expr [expr $i+1]]];
if { [string is digit $num] } {
set CASE_NUM [format "%03d" $num];
puts "case number=$CASE_NUM"
}
break;
}
}
}
#search simulation time
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i]
if {[string equal $para "-t"]} {
if {$i < $max_index} {
set time [lindex $args [expr $i+1]]
if {[regexp {^[0-9]+((n|u|m)s|sec)$} $time]} {
set SIM_TIME $time
puts "simulation time=$SIM_TIME"
} else {
puts "unknow simulation time,set to 1us"
set SIM_TIME 1us
puts "simulation time=$SIM_TIME"
}
break;
}
}
}
#search simulation type
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i]
if {[string equal $para "-timing"]} {
set SIM_TYPE "timing"
puts "simulation type=$SIM_TYPE"
break;
} elseif {[string equal $para "-func"]} {
set SIM_TYPE "func"
puts "simulation type=$SIM_TYPE"
break;
}
}
#search corner type
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i]
if {[string equal $para "-corner"]} {
if {$i < $max_index } {
set corner [lindex $args [expr $i+1]]
#处理run.tcl中再次调用本脚本导致的bug ,删除前导的数字
regsub -nocase {[0-9]+_} $corner "" corner
switch -glob $corner {
"max" {
set CORNER_TYPE 03_max
}
"min" {
set CORNER_TYPE 01_min
}
"type" {
set CORNER_TYPE 02_type
}
default {
puts "unknow corner type,set to 03_max"
set CORNER_TYPE 03_max
}
}
puts "corner type=$CORNER_TYPE"
break;
}
}
}
#search simulation type
for {set i 0} {$i < $argc} {incr i 1} {
set para [lindex $args $i]
if {[string equal $para "-h"]} {
puts "------------------------help------------------------"
puts "-n x:specify case number to be excuted,x stand for case number,default to 0"
puts "-t x:specify simulation time to be excuted,x stand for time,unit may be ns,us,ms,sec,default to 1us"
puts "-timing:specify to excute in timing simulation mode"
puts "-corner x:specify the timing simulation corner,may be max,min,type,default to max"
puts "-c:force to override run.tcl scripts in case directory,be carefull"
puts "-h:to display this help information,it has the highest priority,thus block other options"
puts "----------------------------------------------------"
return 0;
}
}
puts "---->parsing the command line complete ***************************"

View File

@@ -0,0 +1,227 @@
#quit -sim
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#unbound the the "work" lib dir from vsim,to remove it
#when error do not save wave list
if {![string compare [runStatus] "ready" ] || ![string compare [runStatus] "break" ]} {
source savewave.tcl
}
#catch {q -sim} res
#dataset close -all
echo on
.main clear
puts "+++++++++++++++++++++++++++++++++++++++$CASE_NAME start+++++++++++++++++++++++++++++++++++++++"
vmap std $SIM_TOOL_PATH/std ;
vmap ieee $SIM_TOOL_PATH/ieee ;
set FUNC_SOURCE_DIR ../../../01_source/01_func
set TIMING_SOURCE_DIR ../../../01_source/02_timing
set source_vhdl false
set source_verilog false
set LIB_OPTION ""
set LOG_OPTION ""
#if {[string match -nocase {libero*} $FPGA_KIT_VER]} {
# #-----------actel----------
# #puts "IDE IS $FPGA_KIT_VER!"
# foreach file [glob -nocomplain -directory $FUNC_SOURCE_DIR *.vhd] {
# set LOG_OPTION "-vhdlvariablelogging"
# }
# if {[string equal -nocase vhd $TOP_FILE_LANG]} {
# vmap ${ACTEL_FAMILY} $VHDL_LIB/${ACTEL_FAMILY};
# } else {
# vmap ${ACTEL_FAMILY} $VLOG_LIB/${ACTEL_FAMILY};
# }
# set LIB_OPTION "-L ${ACTEL_FAMILY}"
#
#} elseif {[string match -nocase {ise*} $FPGA_KIT_VER]} {
# #puts "IDE IS $FPGA_KIT_VER!"
# foreach file [glob -nocomplain -directory $FUNC_SOURCE_DIR *.vhd] {
# set source_vhdl true
# set LOG_OPTION "-vhdlvariablelogging"
# }
# foreach file [glob -nocomplain -directory $FUNC_SOURCE_DIR *.v] {
# set source_verilog true
# }
# if { [string equal -nocase true $source_vhdl] } {
# #-----------xilinx vhdl----------
# #puts "vhdl file exist!"
# vmap simprim $VHDL_LIB/simprim
# vmap unisim $VHDL_LIB/unisim
# vmap xilinxcorelib $VHDL_LIB/xilinxcorelib
# vmap unimacro $VHDL_LIB/unimacro
# set LIB_OPTION "-L simprim -L unisim -L xilinxcorelib -L unimacro"
# }
#
# if { [string equal -nocase true $source_verilog] } {
# #-----------xilinx verilog----------
# #puts "verilog file exist!"
# vmap unisims_ver $VLOG_LIB/unisims_ver
# vmap simprims_ver $VLOG_LIB/simprims_ver
# vmap xilinxcorelib_ver $VLOG_LIB/xilinxcorelib_ver
# vmap unimacro_ver $VLOG_LIB/unimacro_ver
# vmap secureip $VLOG_LIB/secureip
# set LIB_OPTION "-L unisims_ver -L simprims_ver -L xilinxcorelib_ver -L unimacro_ver -L secureip"
# }
#}
set defs [dict create;] ;
dict append defs CASE_NAME $CASE_NAME;
dict append defs TOP_ENTITY $TOP_ENTITY;
dict append defs TOP_INSTANCE $TOP_INSTANCE;
dict append defs timing;
dict append defs SIM_TIME $SIM_TIME ;
set def_string "";
dict for {def_name def_value} $defs {
set def_string [format "%s+define+%s=%s" $def_string $def_name $def_value;];
}
puts "the define string is:$def_string"
#file delete -force work ;
vlib $WORK_LIB_DIR/${CASE_DIR};
vmap work $WORK_LIB_DIR/${CASE_DIR};
catch { file delete -force $WORK_LIB_DIR/${CASE_DIR}/_lock } res;
catch {file delete -force $WORK_LIB_DIR/${CASE_DIR}/ } res;
#if {![info exists SIM_TYPE]} {set SIM_TYPE func}
#if {![info exists CORNER_TYPE]} {set CORNER_TYPE 03_max}
#if {[info exists 1]} {
# set SIM_TIME $1
#} elseif {![info exists SIM_TIME]} {set SIM_TIME -all}
#by default,all cases use the same source file list
set VLOG_SOURCE_LIST ../file_ver.f;
set VHDL_SOURCE_LIST ../file_vhd.f;
#we specify individual file list for single case
if {[file exists file_ver.f ]} {
puts "---->using case dependent verilog file list"
set VLOG_SOURCE_LIST file_ver.f;
}
if {[file exists file_vhd.f ]} {
puts "---->using case dependent vhdl file list"
set VHDL_SOURCE_LIST file_vhd.f;
}
if {![string equal vhd $TOP_FILE_LANG]} {
set GLBL glbl
}
if {$SIM_TYPE == "timing"} {
set SDF_TYPE "-sdfmax";
set SDFCOM_TYPE "-maxdelays";
puts "*************************timing simulation for CORNER_TYPE= $CORNER_TYPE*************************"
if {[string equal $CORNER_TYPE "01_min" ]} {
set SDF_TYPE "-sdfmin";
set SDFCOM_TYPE "-mindelays";
puts "++++++++++ set SDF_TYPE = -sdfmin ++++++++++";
} elseif {[string equal $CORNER_TYPE "02_type" ]} {
set SDF_TYPE "-sdftyp";
set SDFCOM_TYPE "-typdelays";
puts "++++++++++ set SDF_TYPE = -sdftyp ++++++++++";
} elseif {[string equal $CORNER_TYPE "03_max" ]} {
set SDF_TYPE "-sdfmax";
set SDFCOM_TYPE "-maxdelays";
puts "++++++++++ set SDF_TYPE = -sdfmax ++++++++++";
}
if {[string match -nocase "libero*" $FPGA_KIT_VER]} {
puts "++++++++++ develop kit is libero ++++++++++";
} else {
puts "++++++++++ develop kit is not libero ++++++++++";
set TIMING_SOURCE_DIR ${TIMING_SOURCE_DIR}/${CORNER_TYPE}
}
sdfcom $SDFCOM_TYPE $TIMING_SOURCE_DIR/${TOP_ENTITY}.sdf $TIMING_SOURCE_DIR/${TOP_ENTITY}.sdfcom
#in timing simulation ,here only glbl may be compiled seperately
if {[file exists ${VLOG_SOURCE_LIST}]} {
vlog -incr -quiet -sv +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string
}
vlog -quiet +cover=${COVERAGE_OPTION} -work work ${TIMING_SOURCE_DIR}/*.v
vlog -quiet -sv +cover=${COVERAGE_OPTION} -work work tb.sv $def_string
eval vopt ${GLBL} ${CASE_NAME} +acc=npr ${LIB_OPTION} -o ${CASE_NAME}_opt \
+initmem+0 +initreg+0 +initwire+0;
eval vsim -batch -quiet ${LIB_OPTION} -t 100ps -wlfopt -wlfcompress -nostdout \
+no_notifier +no_tchk_msg\
work.${CASE_NAME}_opt -wlf ${WAVE_OUTPUT_DIR}/${CASE_NAME}_timing.wlf +notimingchecks \
${SDF_TYPE} ${CASE_NAME}/${TOP_INSTANCE}=${TIMING_SOURCE_DIR}/${TOP_ENTITY}.sdfcom;
do ../suppresswarning.tcl
catch {run ${SIM_TIME} } res
} else {
#compile source files
if {[file exists ${VLOG_SOURCE_LIST}]} {
puts "---->compile verilog source files ,testbench and models using $VLOG_SOURCE_LIST........"
# vlog -incr -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003
vlog -sv -vmake -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003
}
if {[file exists ${VHDL_SOURCE_LIST}]} {
puts "---->compile vhdl files using $VHDL_SOURCE_LIST........"
vcom -vmake -nocoverudp -2008 -explicit -quiet +cover=${COVERAGE_OPTION} -work work -f ${VHDL_SOURCE_LIST}
}
# eval vopt ${GLBL} ${CASE_NAME} +acc -o ${CASE_NAME}_opt ${LIB_OPTION} \
# +cover=bcsf+/${CASE_NAME}/${TOP_INSTANCE} -nocoverudp -nocovercells \
# +initmem+0 +initreg+0 +initwire+0 \
# -suppress 2912 \
# -suppress 1127
#to mask 211 error
catch {
if { [string compare [runStatus] "ready" ] && [string compare [runStatus] "break" ]} {
eval vsim ${LOG_OPTION} -batch -quiet -coverage -voptargs="+acc=npr" ${LIB_OPTION} \
-t 1ps -wlfopt -wlfcompress -nostdout \
+initmem+0 +initreg+0 +initwire+0 \
+no_notifier +no_tchk_msg -suppress 3009 -suppress 12110 \
-classdebug \
glbl work.${CASE_NAME} \
-wlf ${WAVE_OUTPUT_DIR}/${CASE_DIR}_timeing.wlf
} else {
restart -f
}
} res;
do ../suppresswarning.tcl
catch {do wave.tcl} res
set TEMP_REF_FILES info.txt;
write report -l $TEMP_REF_FILES
catch {run ${SIM_TIME} } res
do ../saveucdb.tcl
#}
set current_path [pwd]
puts "+++++++++++++++++++++++++++current path=$current_path++++++++++++++++++++++++++++++++"

View File

@@ -0,0 +1,15 @@
#usage do runall.tcl 1ms
set ROOT_PATH [pwd]
for {set NUMBER 3} { $NUMBER < 14} {incr NUMBER} {
set CASE_NUMBER [format "%03d" $NUMBER]
puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>$CASE_NUMBER start>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
catch {do runone.tcl -n $CASE_NUMBER -t $1} result
quit -sim
cd ${ROOT_PATH}
puts "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<$CASE_NUMBER end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
}

View File

@@ -0,0 +1,80 @@
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#clear the simulator transcript window and make the wave,data & coverage director
do clear.tcl
#preset envieroment variables
do globalset.tcl
set ROOT_PATH [pwd];
#import common routines
source functions.tcl
source parse_args.tcl;
set CASE_DIR ${SIM_TYPE}${CASE_NUM}
#we discard the case_num,thus all cases use the same case name.
#thus the signal_name in the lastwave.tcl will be case independent
#it's convinient to share and inherit lastwave in different case
set CASE_NAME ${SIM_TYPE}${CASE_NUM}
#puts "SIM_TYPE = $SIM_TYPE "
#puts "CASE_NUM = $CASE_NUM "
#puts "SIM_TIME = $SIM_TIME "
#puts "CORNER_TYPE = $CORNER_TYPE"
#puts "CASE_NAME = $CASE_NAME "
#copy modelsim.ini to case dir,and enter the case dependent directory
file copy -force modelsim.ini ./${CASE_DIR}
#by default,all cases use the same run.tcl
#we can make trivial change to each case
file copy -force run_template.tcl ./${CASE_DIR}/run.tcl
#we can use -c command to override run.tcl
puts "---->check if override the run.tcl commandary..............."
if {[string equal $COPY_RUN_TEMPLATE "yes" ]} {
file copy -force run_template.tcl ./${CASE_DIR}/run.tcl
puts "<<<<<<<<<<force copy run_template.tcl to ${CASE_DIR} dirctory>>>>>>>>>"
}
#force generate instantiate_top.sv and override exist file
if {[info exists GEN_INSTANTIATE_TOP] && [string equal $GEN_INSTANTIATE_TOP "yes" ]} {
exec python ../../../../../python/gen_instantiate_top.py ../../01_source/01_func/${TOP_FILE}
}
if {![file exists ./instantiate_top.sv]} {
exec python ../../../../../python/gen_instantiate_top.py ../../01_source/01_func/${TOP_FILE}
}
cd ${CASE_DIR}
if { [ catch {do run.tcl -t $SIM_TIME -type $SIM_TYPE -corner $CORNER_TYPE} result ] } {
quit -sim
cd ${ROOT_PATH}
}
set current_path [pwd]
puts "+++++++++++++++++++++++++++current path=$current_path++++++++++++++++++++++++++++++++"

View File

@@ -0,0 +1,14 @@
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
#ATTTION : DO NOT MODIFY THE WHOLE FILE
coverage save ${COVERAGE_OUTPUT_DIR}/${CASE_NAME}.ucdb

View File

@@ -0,0 +1,8 @@
del /f /q transcript
start c:\questasim64_10.7\win64\questasim.exe -do sstc.preference
rem start C:\questasim64_10.4c\win64\questasim.exe -do sstc.preference
rem start D:\questasim64_10.7\win64\questasim.exe
rem vsim -batch -logfile this.log
rem vsim -c

View File

@@ -0,0 +1,21 @@
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#ATTTION : MODIFY THIS FILE AS YOU WANT
#0=note,1=warning,2=error,3=failure,4=fatal
# set BreakOnAssertion 3 ;
# set IgnoreNote 1 ;
# set IgnoreWarning 1 ;
# #set IgnoreError 1 ;
# #set IgnoreFailure 1 ;
# set IgnoreSVAInfo 1 ;
# set IgnoreSVAWarning 1 ;
# #set IgnoreSVAError 1 ;
# #set IgnoreSVAFatal 1 ;
# set NumericStdNoWarnings 1 ;
# set StdArithNoWarnings 1 ;

View File

@@ -0,0 +1,389 @@
# Reading C:/questasim64_10.7/tcl/vsim/pref.tcl
# // Questa Sim-64
# // Version 10.7 win64 Dec 7 2017
# //
# // Copyright 1991-2017 Mentor Graphics Corporation
# // All Rights Reserved.
# //
# // QuestaSim and its associated documentation contain trade
# // secrets and commercial or financial information that are the property of
# // Mentor Graphics Corporation and are privileged, confidential,
# // and exempt from disclosure under the Freedom of Information Act,
# // 5 U.S.C. Section 552. Furthermore, this information
# // is prohibited from disclosure under the Trade Secrets Act,
# // 18 U.S.C. Section 1905.
# //
# sstc.preference
# invalid command name "sstc.preference"
do runone.tcl -n 1 -t 10ms
# on
# stream_rx_if.sv
# Behavioral
# sbfce
# ../../../../../../03_simlib
# c:/questasim64_10.7
# proasic3l
# questasim
# 10.7
# nt64
# libero11.8
# ../coverage
# ../wave
# ../work
# stream_rx_if
# .sv
# u0_stream_rx_if
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim
# ---->parsing the command line....argc=4,args=-n 1 -t 10ms*************************
# case number=001
# simulation time=10ms
# ---->parsing the command line complete ***************************
# func001
# func001
# ---->check if override the run.tcl commandary...............
# reading modelsim.ini
# on
# +++++++++++++++++++++++++++++++++++++++func001 start+++++++++++++++++++++++++++++++++++++++
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap std c:/questasim64_10.7/std
# Modifying modelsim.ini
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap ieee c:/questasim64_10.7/ieee
# Modifying modelsim.ini
# ../../../01_source/01_func
# ../../../01_source/02_timing
# false
# false
# CASE_NAME func001
# CASE_NAME func001 TOP_ENTITY stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {}
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {} SIM_TIME 10ms
# the define string is:+define+CASE_NAME=func001+define+TOP_ENTITY=stream_rx_if+define+TOP_INSTANCE=u0_stream_rx_if+define+timing=+define+SIM_TIME=10ms
# ** Warning: (vlib-34) Library already exists at "../work/func001".
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap work ../work/func001
# Modifying modelsim.ini
# 0
# 0
# ../file_ver.f
# ../file_vhd.f
# glbl
# ---->compile verilog source files ,testbench and models using ../file_ver.f........
# ** Warning: (vlog-13288) Multiple macros defined in +define+ command line switch.
# ** Warning: tb.sv(7): (vlib-2240) Treating stand-alone use of function 'mti_Cmd' as an implicit VOID cast.
# ** Error: ../../src/stream_rx_if.sv(114): (vlib-2730) Undefined variable: 'tx_state_next'.
# ** Error: c:/questasim64_10.7/win64/vlog failed.
# Error in macro ./run.tcl line 224
# c:/questasim64_10.7/win64/vlog failed.
# while executing
# "vlog -sv -vmake -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003"
# invoked from within
# "if {$SIM_TYPE == "timing"} {
#
# set SDF_TYPE "-sdfmax";
# set SDFCOM_TYPE "-maxdelays";
#
# puts "*************************timing simulat..."
do runone.tcl -n 1 -t 10ms
# reading modelsim.ini
# on
# stream_rx_if.sv
# Behavioral
# sbfce
# ../../../../../../03_simlib
# c:/questasim64_10.7
# proasic3l
# questasim
# 10.7
# nt64
# libero11.8
# ../coverage
# ../wave
# ../work
# stream_rx_if
# .sv
# u0_stream_rx_if
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim
# ---->parsing the command line....argc=4,args=-n 1 -t 10ms*************************
# case number=001
# simulation time=10ms
# ---->parsing the command line complete ***************************
# func001
# func001
# ---->check if override the run.tcl commandary...............
# reading modelsim.ini
# on
# +++++++++++++++++++++++++++++++++++++++func001 start+++++++++++++++++++++++++++++++++++++++
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap std c:/questasim64_10.7/std
# Modifying modelsim.ini
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap ieee c:/questasim64_10.7/ieee
# Modifying modelsim.ini
# ../../../01_source/01_func
# ../../../01_source/02_timing
# false
# false
# CASE_NAME func001
# CASE_NAME func001 TOP_ENTITY stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {}
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {} SIM_TIME 10ms
# the define string is:+define+CASE_NAME=func001+define+TOP_ENTITY=stream_rx_if+define+TOP_INSTANCE=u0_stream_rx_if+define+timing=+define+SIM_TIME=10ms
# ** Warning: (vlib-34) Library already exists at "../work/func001".
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap work ../work/func001
# Modifying modelsim.ini
# 0
# 0
# ../file_ver.f
# ../file_vhd.f
# glbl
# ---->compile verilog source files ,testbench and models using ../file_ver.f........
# ** Warning: (vlog-13288) Multiple macros defined in +define+ command line switch.
# ** Warning: tb.sv(7): (vlib-2240) Treating stand-alone use of function 'mti_Cmd' as an implicit VOID cast.
# ** Error: ../../src/stream_rx_if.sv(75): (vlib-13003) Enum member 'RX_INTERVAL' has value that is outside the representable range of the enum.
# ** Error: c:/questasim64_10.7/win64/vlog failed.
# Error in macro ./run.tcl line 224
# c:/questasim64_10.7/win64/vlog failed.
# while executing
# "vlog -sv -vmake -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003"
# invoked from within
# "if {$SIM_TYPE == "timing"} {
#
# set SDF_TYPE "-sdfmax";
# set SDFCOM_TYPE "-maxdelays";
#
# puts "*************************timing simulat..."
do runone.tcl -n 1 -t 10ms
# reading modelsim.ini
# on
# stream_rx_if.sv
# Behavioral
# sbfce
# ../../../../../../03_simlib
# c:/questasim64_10.7
# proasic3l
# questasim
# 10.7
# nt64
# libero11.8
# ../coverage
# ../wave
# ../work
# stream_rx_if
# .sv
# u0_stream_rx_if
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim
# ---->parsing the command line....argc=4,args=-n 1 -t 10ms*************************
# case number=001
# simulation time=10ms
# ---->parsing the command line complete ***************************
# func001
# func001
# ---->check if override the run.tcl commandary...............
# reading modelsim.ini
# on
# +++++++++++++++++++++++++++++++++++++++func001 start+++++++++++++++++++++++++++++++++++++++
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap std c:/questasim64_10.7/std
# Modifying modelsim.ini
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap ieee c:/questasim64_10.7/ieee
# Modifying modelsim.ini
# ../../../01_source/01_func
# ../../../01_source/02_timing
# false
# false
# CASE_NAME func001
# CASE_NAME func001 TOP_ENTITY stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {}
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {} SIM_TIME 10ms
# the define string is:+define+CASE_NAME=func001+define+TOP_ENTITY=stream_rx_if+define+TOP_INSTANCE=u0_stream_rx_if+define+timing=+define+SIM_TIME=10ms
# ** Warning: (vlib-34) Library already exists at "../work/func001".
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap work ../work/func001
# Modifying modelsim.ini
# 0
# 0
# ../file_ver.f
# ../file_vhd.f
# glbl
# ---->compile verilog source files ,testbench and models using ../file_ver.f........
# ** Warning: (vlog-13288) Multiple macros defined in +define+ command line switch.
# ** Warning: tb.sv(7): (vlib-2240) Treating stand-alone use of function 'mti_Cmd' as an implicit VOID cast.
# vsim -quiet -coverage -voptargs=""+acc=npr"" -t 1ps -wlfopt -wlfcompress -nostdout "+initmem+0" "+initreg+0" "+initwire+0" "+no_notifier" "+no_tchk_msg" -suppress 3009 -suppress 12110 -classdebug glbl work.func001 -wlf ../wave/func001_timeing.wlf
# Start time: 17:39:37 on Nov 21,2025
# ** Note: (vsim-3812) Design is being optimized...
# ** Error (suppressible): ../instantiate_top.sv(49): (vopt-2247) The implicit port connection (.*) did not find a matching port, net, variable or interface instance for port 'buf_clk'.
# ** Error (suppressible): ../instantiate_top.sv(49): (vopt-2247) The implicit port connection (.*) did not find a matching port, net, variable or interface instance for port 'buf_rdata'.
# ** Error (suppressible): ../instantiate_top.sv(49): (vopt-2247) The implicit port connection (.*) did not find a matching port, net, variable or interface instance for port 'list_clk'.
# Optimization failed
# Error loading design
# Error: Error loading design
# Pausing macro execution
# MACRO ./run.tcl PAUSED at line 224
do runone.tcl -n 1 -t 10ms
# End time: 17:43:27 on Nov 21,2025, Elapsed time: 0:03:50
# Errors: 3, Warnings: 0
# reading modelsim.ini
# on
# stream_rx_if.sv
# Behavioral
# sbfce
# ../../../../../../03_simlib
# c:/questasim64_10.7
# proasic3l
# questasim
# 10.7
# nt64
# libero11.8
# ../coverage
# ../wave
# ../work
# stream_rx_if
# .sv
# u0_stream_rx_if
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim
# ---->parsing the command line....argc=4,args=-n 1 -t 10ms*************************
# case number=001
# simulation time=10ms
# ---->parsing the command line complete ***************************
# func001
# func001
# ---->check if override the run.tcl commandary...............
# reading modelsim.ini
# on
# +++++++++++++++++++++++++++++++++++++++func001 start+++++++++++++++++++++++++++++++++++++++
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap std c:/questasim64_10.7/std
# Modifying modelsim.ini
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap ieee c:/questasim64_10.7/ieee
# Modifying modelsim.ini
# ../../../01_source/01_func
# ../../../01_source/02_timing
# false
# false
# CASE_NAME func001
# CASE_NAME func001 TOP_ENTITY stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {}
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {} SIM_TIME 10ms
# the define string is:+define+CASE_NAME=func001+define+TOP_ENTITY=stream_rx_if+define+TOP_INSTANCE=u0_stream_rx_if+define+timing=+define+SIM_TIME=10ms
# ** Warning: (vlib-34) Library already exists at "../work/func001".
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap work ../work/func001
# Modifying modelsim.ini
# 0
# 0
# ../file_ver.f
# ../file_vhd.f
# glbl
# ---->compile verilog source files ,testbench and models using ../file_ver.f........
# ** Warning: (vlog-13288) Multiple macros defined in +define+ command line switch.
# ** Warning: tb.sv(7): (vlib-2240) Treating stand-alone use of function 'mti_Cmd' as an implicit VOID cast.
# ** Error: (vlib-13069) ../../src/stream_rx_if.sv(41): near "localparam": syntax error, unexpected localparam, expecting IDENTIFIER or TYPE_IDENTIFIER or NETTYPE_IDENTIFIER.
# ** Error: ../../src/stream_rx_if.sv(62): (vlib-2730) Undefined variable: 'ADDR_STEP'.
# ** Error: ../../src/stream_rx_if.sv(114): (vlib-2730) Undefined variable: 'SEG_TOTAL'.
# ** Error: ../../src/stream_rx_if.sv(180): (vlib-2730) Undefined variable: 'SEG_ADDR_WIDTH'.
# ** Error: ../../src/stream_rx_if.sv(190): (vlib-2730) Undefined variable: 'SEG_TOTAL'.
# ** Error: ../../src/stream_rx_if.sv(200): (vlib-2730) Undefined variable: 'SEG_ADDR_WIDTH'.
# ** Error: ../../src/stream_rx_if.sv(200): (vlib-2730) Undefined variable: 'SEG_TOTAL'.
# ** Error: ../../src/stream_rx_if.sv(226): (vlib-2730) Undefined variable: 'SEG_TOTAL'.
# ** Error: ../../src/stream_rx_if.sv(254): (vlib-2730) Undefined variable: 'SEG_ADDR_WIDTH'.
# ** Error: ../../src/stream_rx_if.sv(267): (vlib-2730) Undefined variable: 'SEG_ADDR_WIDTH'.
# ** Error: ../../src/stream_rx_if.sv(283): (vlib-2730) Undefined variable: 'SEG_ADDR_WIDTH'.
# ** Error: c:/questasim64_10.7/win64/vlog failed.
# Error in macro ./run.tcl line 224
# c:/questasim64_10.7/win64/vlog failed.
# while executing
# "vlog -sv -vmake -quiet +cover=${COVERAGE_OPTION} +incdir+../ -work work -f ${VLOG_SOURCE_LIST} $def_string -suppress 12003"
# invoked from within
# "if {$SIM_TYPE == "timing"} {
#
# set SDF_TYPE "-sdfmax";
# set SDFCOM_TYPE "-maxdelays";
#
# puts "*************************timing simulat..."
do runone.tcl -n 1 -t 10ms
# reading modelsim.ini
# on
# stream_rx_if.sv
# Behavioral
# sbfce
# ../../../../../../03_simlib
# c:/questasim64_10.7
# proasic3l
# questasim
# 10.7
# nt64
# libero11.8
# ../coverage
# ../wave
# ../work
# stream_rx_if
# .sv
# u0_stream_rx_if
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim
# ---->parsing the command line....argc=4,args=-n 1 -t 10ms*************************
# case number=001
# simulation time=10ms
# ---->parsing the command line complete ***************************
# func001
# func001
# ---->check if override the run.tcl commandary...............
# reading modelsim.ini
# on
# +++++++++++++++++++++++++++++++++++++++func001 start+++++++++++++++++++++++++++++++++++++++
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap std c:/questasim64_10.7/std
# Modifying modelsim.ini
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap ieee c:/questasim64_10.7/ieee
# Modifying modelsim.ini
# ../../../01_source/01_func
# ../../../01_source/02_timing
# false
# false
# CASE_NAME func001
# CASE_NAME func001 TOP_ENTITY stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {}
# CASE_NAME func001 TOP_ENTITY stream_rx_if TOP_INSTANCE u0_stream_rx_if timing {} SIM_TIME 10ms
# the define string is:+define+CASE_NAME=func001+define+TOP_ENTITY=stream_rx_if+define+TOP_INSTANCE=u0_stream_rx_if+define+timing=+define+SIM_TIME=10ms
# ** Warning: (vlib-34) Library already exists at "../work/func001".
# QuestaSim-64 vmap 10.7 Lib Mapping Utility 2017.12 Dec 7 2017
# vmap work ../work/func001
# Modifying modelsim.ini
# 0
# 0
# ../file_ver.f
# ../file_vhd.f
# glbl
# ---->compile verilog source files ,testbench and models using ../file_ver.f........
# ** Warning: (vlog-13288) Multiple macros defined in +define+ command line switch.
# ** Warning: tb.sv(7): (vlib-2240) Treating stand-alone use of function 'mti_Cmd' as an implicit VOID cast.
# vsim -quiet -coverage -voptargs=""+acc=npr"" -t 1ps -wlfopt -wlfcompress -nostdout "+initmem+0" "+initreg+0" "+initwire+0" "+no_notifier" "+no_tchk_msg" -suppress 3009 -suppress 12110 -classdebug glbl work.func001 -wlf ../wave/func001_timeing.wlf
# Start time: 17:44:11 on Nov 21,2025
# ** Note: (vsim-3812) Design is being optimized...
# ** Note: (vopt-143) Recognized 1 FSM in module "stream_rx_if(fast)".
# ** Warning: tb.sv(7): (vopt-2240) Treating stand-alone use of function 'mti_Cmd' as an implicit VOID cast.
# ---->checing the simulator status to decide whether to restore the wave session..................
# ---->the runstatus is :ready
# ---->trying restore to saved wave window..................
# 0
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim/func001
# +++++++++++++++++++++++++++current path=C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim/func001++++++++++++++++++++++++++++++++
# C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim/func001
# +++++++++++++++++++++++++++current path=C:/Users/le/workspace/work/repo/FPGA_DESIGN_IP/stream_rx_buffer/sim/func001++++++++++++++++++++++++++++++++
add wave -position insertpoint sim:/func001/u0_stream_rx_if/*
# End time: 17:45:00 on Nov 21,2025, Elapsed time: 0:00:49
# Errors: 0, Warnings: 1

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
# This file is automatically written. Do not modify.
proc gen_USERPARAMETER_CHANNEL_INDEX_VALUE {CHANNEL_INDEX } {expr $CHANNEL_INDEX}

View File

@@ -0,0 +1,393 @@
module stream_rx_ctrl #(
parameter FREQ_HZ = 125_000_000,
parameter CHANNEL_INDEX = 0,
parameter BUF_ADDR_WIDTH = 24,
parameter BTT_WIDTH = 16,
parameter AXI_ADDR_WIDTH = 32,
parameter STREAM_WIDTH = 8,
parameter CMD_WIDTH = 72,
parameter STATUS_WIDTH = 32
) (
input logic clk,
input logic rst_n,
input logic [31:0] config_00,
input logic [31:0] config_01,
input logic [31:0] config_02,
input logic [31:0] config_03,
output logic [31:0] status_00,
output logic [31:0] status_01,
output logic [31:0] status_02,
output logic [31:0] status_03,
output logic [31:0] status_04,
output logic [31:0] status_05,
output logic [31:0] status_06,
output logic [31:0] status_07,
input logic s2mm_err,
output logic enable,
output logic update_ptr,
output logic s2mm_resetn,
// ingress stream interface
input logic [STREAM_WIDTH-1:0] ingress_tdata,
input logic ingress_tvalid,
input logic ingress_tlast,
input logic [STREAM_WIDTH/8-1:0] ingress_tkeep,
input logic [STREAM_WIDTH/8-1:0] ingress_tstrb,
output logic ingress_tready,
// egress stream interface
output logic [STREAM_WIDTH-1:0] egress_tdata,
output logic egress_tvalid,
output logic egress_tlast,
output logic [STREAM_WIDTH/8-1:0] egress_tkeep,
output logic [STREAM_WIDTH/8-1:0] egress_tstrb,
input logic egress_tready,
// command stream interface
output logic [CMD_WIDTH-1:0] cmd_tdata,
output logic cmd_tvalid,
output logic cmd_tlast,
output logic [CMD_WIDTH/8-1:0] cmd_tkeep,
output logic [CMD_WIDTH/8-1:0] cmd_tstrb,
input logic cmd_tready,
// status stream interface
input logic [STATUS_WIDTH-1:0] status_tdata,
input logic status_tvalid,
input logic status_tlast,
input logic [STATUS_WIDTH/8-1:0] status_tkeep,
input logic [STATUS_WIDTH/8-1:0] status_tstrb,
output logic status_tready
);
localparam ADDR_STEP = STREAM_WIDTH / 8;
typedef enum logic [1:0] {
CTRL_IDLE,
CTRL_WRITE_CMD,
CTRL_WAIT_STATUS,
CTRL_RESET_S2MM
} ctrl_state_t;
ctrl_state_t ctrl_state, ctrl_state_next;
logic [3:0] s2mm_reset_width;
logic [7:0] fsm_hardcode;
logic [BUF_ADDR_WIDTH-1:0] buf_offset;
logic [BUF_ADDR_WIDTH-1:0] buf_head;
logic burst_in_progress;
logic burst_ending;
logic [BUF_ADDR_WIDTH-1:0] beats_in_burst;
logic [BTT_WIDTH-1:0] brcvd;
logic interr;
logic decerr;
logic slverr;
logic [AXI_ADDR_WIDTH-1:0] saddr;
logic drr;
logic eof;
logic [5:0] dsa;
logic burst_type;
logic [22:0] btt;
logic [CMD_WIDTH-1:0] mover_cmd;
logic [31:0] counter_mover_cmd;
logic [31:0] counter_mover_status;
logic [31:0] counter_tfifo_bursts;
logic [31:0] counter_tfifo_beats;
logic [31:0] counter_mover_beats;
logic [ 7:0] counter_mover_split;
logic [ 7:0] counter_mover_reset;
logic [ 7:0] counter_mover_interr;
logic [ 7:0] counter_mover_decerr;
logic [ 7:0] counter_mover_slverr;
logic [ 7:0] counter_burst_abort;
assign enable = config_00[0];
assign status_00 = {counter_mover_reset, counter_mover_split, fsm_hardcode, 4'(s2mm_err), 4'(enable)};
assign status_01 = counter_tfifo_bursts;
assign status_02 = counter_tfifo_beats;
assign status_03 = counter_mover_beats;
assign status_04 = {(32-BUF_ADDR_WIDTH)'(0), buf_head};
assign status_05 = counter_mover_cmd;
assign status_06 = counter_mover_status;
assign status_07 = {counter_burst_abort, counter_mover_slverr, counter_mover_decerr, counter_mover_interr};
assign brcvd = status_tdata[8+:BTT_WIDTH];
assign interr = status_tdata[4];
assign decerr = status_tdata[5];
assign slverr = status_tdata[6];
assign saddr = {(AXI_ADDR_WIDTH-BUF_ADDR_WIDTH)'(CHANNEL_INDEX<<1), buf_head}; // base address 0
assign drr = 1'b0;
assign eof = 1'b0;
assign dsa = 6'h00;
assign burst_type = 1'b1; // INCR
assign btt = {23{1'b1}}; // max burst
assign mover_cmd = {(CMD_WIDTH-AXI_ADDR_WIDTH-32)'(0), saddr, drr, eof, dsa, burst_type, btt};
always_ff @(posedge clk) begin
if (!rst_n) begin
fsm_hardcode <= 0;
end else begin
case (ctrl_state)
CTRL_IDLE:
fsm_hardcode <= 8'h0;
CTRL_WRITE_CMD:
fsm_hardcode <= 8'h1;
CTRL_WAIT_STATUS:
fsm_hardcode <= 8'h2;
CTRL_RESET_S2MM:
fsm_hardcode <= 8'h3;
default:
fsm_hardcode <= 8'hFF;
endcase
end
end
// FSM: register update
always_ff @(posedge clk) begin
if (!rst_n) begin
ctrl_state <= CTRL_IDLE;
end else begin
ctrl_state <= ctrl_state_next;
end
end
// FSM: next state logic
always_comb begin
ctrl_state_next = ctrl_state;
case (ctrl_state)
CTRL_IDLE: begin
if (enable) begin
ctrl_state_next = CTRL_WRITE_CMD;
end
end
CTRL_WRITE_CMD: begin
if (cmd_tvalid && cmd_tready) begin
ctrl_state_next = CTRL_WAIT_STATUS;
end
end
CTRL_WAIT_STATUS: begin
if (enable) begin
if (status_tvalid && status_tready) begin
ctrl_state_next = CTRL_WRITE_CMD;
end
end else begin
if (burst_in_progress == 0 && counter_mover_cmd > counter_tfifo_bursts) begin // more cmd than enqueued burst, so no need to wait the last cmd, go ahead reset S2MM
ctrl_state_next = CTRL_RESET_S2MM;
end else if (status_tvalid && status_tready) begin // else wait for last cmd to complete
if (burst_in_progress == 0) begin // counter_tfifo_bursts won't change
if (counter_mover_cmd < counter_tfifo_bursts) begin // pending data in tfifo, so issue next cmd
ctrl_state_next = CTRL_WRITE_CMD;
end else begin // counter_mover_cmd == counter_tfifo_bursts, all done, so lucky
ctrl_state_next = CTRL_IDLE;
end
end else begin // counter_tfifo_bursts will increase when burst complete, so just issue next cmd
ctrl_state_next = CTRL_WRITE_CMD;
end
end
end
end
CTRL_RESET_S2MM: begin
if (s2mm_reset_width >= 8)
ctrl_state_next = CTRL_IDLE;
end
default: begin
ctrl_state_next = CTRL_IDLE;
end
endcase
end
// FSM: output logic
always_ff @(posedge clk) begin
if (!rst_n) begin
update_ptr <= 1'b0;
s2mm_reset_width <= 0;
s2mm_resetn <= 0;
burst_in_progress <= 0;
burst_ending <= 0;
beats_in_burst <= 0;
cmd_tdata <= 0;
cmd_tvalid <= 0;
cmd_tlast <= 0;
cmd_tkeep <= 0;
cmd_tstrb <= 0;
status_tready <= 0;
egress_tdata <= 0;
egress_tvalid <= 0;
egress_tlast <= 0;
egress_tkeep <= 0;
egress_tstrb <= 0;
ingress_tready <= 0;
buf_offset <= 0;
buf_head <= 0;
counter_mover_cmd <= 0;
counter_mover_status <= 0;
counter_tfifo_bursts <= 0;
counter_tfifo_beats <= 0;
counter_mover_beats <= 0;
counter_mover_split <= 0;
counter_mover_reset <= 0;
counter_mover_interr <= 0;
counter_mover_decerr <= 0;
counter_mover_slverr <= 0;
counter_burst_abort <= 0;
end else begin
update_ptr <= 1'b0;
s2mm_resetn <= 1'b1;
s2mm_reset_width <= 0;
cmd_tvalid <= 1'b0;
cmd_tlast <= 1'b0;
cmd_tkeep <= '0;
cmd_tstrb <= '0;
status_tready <= 1'b0;
if (status_tvalid) begin
status_tready <= 1'b1;
end
if (cmd_tvalid && cmd_tready) begin
counter_mover_cmd <= counter_mover_cmd + 1'b1;
end
if (status_tvalid && status_tready) begin
counter_mover_status <= counter_mover_status + 1'b1;
update_ptr <= 1'b1;
buf_head <= buf_head + brcvd;
counter_mover_beats <= counter_mover_beats + brcvd;
if (interr) begin
counter_mover_interr <= counter_mover_interr + 1'b1;
end
if (decerr) begin
counter_mover_decerr <= counter_mover_decerr + 1'b1;
end
if (slverr) begin
counter_mover_slverr <= counter_mover_slverr + 1'b1;
end
end
ingress_tready <= 1'b0;
if (ingress_tvalid && (!ingress_tkeep || !egress_tvalid)) begin
ingress_tready <= 1'b1;
end
if (egress_tready) begin
egress_tvalid <= 1'b0;
egress_tlast <= 1'b0;
egress_tkeep <= 1'b0;
egress_tstrb <= 1'b0;
end
if (egress_tvalid && egress_tkeep && egress_tready) begin
buf_offset <= buf_offset + ADDR_STEP;
counter_tfifo_beats <= counter_tfifo_beats + ADDR_STEP;
beats_in_burst <= beats_in_burst + ADDR_STEP;
end
if (egress_tvalid && egress_tlast && egress_tready) begin
burst_in_progress <= 0;
beats_in_burst <= 0;
burst_ending <= 0;
counter_tfifo_bursts <= counter_tfifo_bursts + 1'b1;
end
if (enable) begin
if (ingress_tvalid && ingress_tkeep && !egress_tvalid) begin
burst_in_progress <= 1'b1;
egress_tvalid <= 1'b1;
egress_tdata <= ingress_tdata;
egress_tlast <= ingress_tlast;
egress_tkeep <= ingress_tkeep;
egress_tstrb <= ingress_tstrb;
if (ingress_tkeep && buf_offset == (2**BUF_ADDR_WIDTH - ADDR_STEP)) begin
egress_tlast <= 1'b1;
//buf_offset <= 0;
if (ingress_tlast == 0) begin
counter_mover_split <= counter_mover_split + 1'b1;
end
burst_ending <= 1'b1;
end
if (ingress_tlast) begin
burst_ending <= 1'b1;
end
end
end else begin
ingress_tready <= 1'b1;
if (burst_in_progress && !burst_ending && beats_in_burst > 0) begin
egress_tvalid <= 1'b1;
egress_tdata <= 'hFA;
egress_tlast <= 1'b1;
egress_tkeep <= 0;
egress_tstrb <= 0;
burst_ending <= 1'b1;
counter_burst_abort <= counter_burst_abort + 1'b1;
end
end
case (ctrl_state)
CTRL_IDLE: begin
cmd_tdata <= 0;
egress_tdata <= 0;
egress_tvalid <= 0;
egress_tlast <= 0;
egress_tkeep <= 0;
egress_tstrb <= 0;
ingress_tready <= 1'b1;
end
CTRL_WRITE_CMD: begin
cmd_tdata <= mover_cmd;
cmd_tvalid <= 1'b1;
cmd_tlast <= 1'b1;
cmd_tkeep <= {CMD_WIDTH/8{1'b1}};
cmd_tstrb <= {CMD_WIDTH/8{1'b1}};
if (cmd_tvalid && cmd_tready) begin
cmd_tvalid <= 0;
cmd_tlast <= 0;
cmd_tkeep <= 0;
cmd_tstrb <= 0;
end
end
CTRL_WAIT_STATUS: begin
// do nothing
end
CTRL_RESET_S2MM: begin
ingress_tready <= 1'b1;
s2mm_resetn <= 1'b0;
s2mm_reset_width <= s2mm_reset_width + 1'b1;
if (s2mm_reset_width == 8) begin
counter_tfifo_bursts <= counter_tfifo_bursts + 1'b1;
counter_mover_status <= counter_mover_status + 1'b1;
counter_mover_reset <= counter_mover_reset + 1'b1;
end
end
default: begin
// do nothing
end
endcase
end
end
endmodule

View File

@@ -0,0 +1,130 @@
# Definitional proc to organize widgets for parameters.
proc init_gui { IPINST } {
ipgui::add_param $IPINST -name "Component_Name"
#Adding Page
set Page_0 [ipgui::add_page $IPINST -name "Page 0"]
ipgui::add_param $IPINST -name "AXI_ADDR_WIDTH" -parent ${Page_0}
ipgui::add_param $IPINST -name "BTT_WIDTH" -parent ${Page_0}
ipgui::add_param $IPINST -name "BUF_ADDR_WIDTH" -parent ${Page_0}
ipgui::add_param $IPINST -name "CHANNEL_INDEX" -parent ${Page_0}
ipgui::add_param $IPINST -name "CMD_WIDTH" -parent ${Page_0}
ipgui::add_param $IPINST -name "FREQ_HZ" -parent ${Page_0}
ipgui::add_param $IPINST -name "STATUS_WIDTH" -parent ${Page_0}
ipgui::add_param $IPINST -name "STREAM_WIDTH" -parent ${Page_0}
}
proc update_PARAM_VALUE.AXI_ADDR_WIDTH { PARAM_VALUE.AXI_ADDR_WIDTH } {
# Procedure called to update AXI_ADDR_WIDTH when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.AXI_ADDR_WIDTH { PARAM_VALUE.AXI_ADDR_WIDTH } {
# Procedure called to validate AXI_ADDR_WIDTH
return true
}
proc update_PARAM_VALUE.BTT_WIDTH { PARAM_VALUE.BTT_WIDTH } {
# Procedure called to update BTT_WIDTH when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.BTT_WIDTH { PARAM_VALUE.BTT_WIDTH } {
# Procedure called to validate BTT_WIDTH
return true
}
proc update_PARAM_VALUE.BUF_ADDR_WIDTH { PARAM_VALUE.BUF_ADDR_WIDTH } {
# Procedure called to update BUF_ADDR_WIDTH when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.BUF_ADDR_WIDTH { PARAM_VALUE.BUF_ADDR_WIDTH } {
# Procedure called to validate BUF_ADDR_WIDTH
return true
}
proc update_PARAM_VALUE.CHANNEL_INDEX { PARAM_VALUE.CHANNEL_INDEX } {
# Procedure called to update CHANNEL_INDEX when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.CHANNEL_INDEX { PARAM_VALUE.CHANNEL_INDEX } {
# Procedure called to validate CHANNEL_INDEX
return true
}
proc update_PARAM_VALUE.CMD_WIDTH { PARAM_VALUE.CMD_WIDTH } {
# Procedure called to update CMD_WIDTH when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.CMD_WIDTH { PARAM_VALUE.CMD_WIDTH } {
# Procedure called to validate CMD_WIDTH
return true
}
proc update_PARAM_VALUE.FREQ_HZ { PARAM_VALUE.FREQ_HZ } {
# Procedure called to update FREQ_HZ when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.FREQ_HZ { PARAM_VALUE.FREQ_HZ } {
# Procedure called to validate FREQ_HZ
return true
}
proc update_PARAM_VALUE.STATUS_WIDTH { PARAM_VALUE.STATUS_WIDTH } {
# Procedure called to update STATUS_WIDTH when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.STATUS_WIDTH { PARAM_VALUE.STATUS_WIDTH } {
# Procedure called to validate STATUS_WIDTH
return true
}
proc update_PARAM_VALUE.STREAM_WIDTH { PARAM_VALUE.STREAM_WIDTH } {
# Procedure called to update STREAM_WIDTH when any of the dependent parameters in the arguments change
}
proc validate_PARAM_VALUE.STREAM_WIDTH { PARAM_VALUE.STREAM_WIDTH } {
# Procedure called to validate STREAM_WIDTH
return true
}
proc update_MODELPARAM_VALUE.FREQ_HZ { MODELPARAM_VALUE.FREQ_HZ PARAM_VALUE.FREQ_HZ } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.FREQ_HZ}] ${MODELPARAM_VALUE.FREQ_HZ}
}
proc update_MODELPARAM_VALUE.CHANNEL_INDEX { MODELPARAM_VALUE.CHANNEL_INDEX PARAM_VALUE.CHANNEL_INDEX } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.CHANNEL_INDEX}] ${MODELPARAM_VALUE.CHANNEL_INDEX}
}
proc update_MODELPARAM_VALUE.BUF_ADDR_WIDTH { MODELPARAM_VALUE.BUF_ADDR_WIDTH PARAM_VALUE.BUF_ADDR_WIDTH } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.BUF_ADDR_WIDTH}] ${MODELPARAM_VALUE.BUF_ADDR_WIDTH}
}
proc update_MODELPARAM_VALUE.BTT_WIDTH { MODELPARAM_VALUE.BTT_WIDTH PARAM_VALUE.BTT_WIDTH } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.BTT_WIDTH}] ${MODELPARAM_VALUE.BTT_WIDTH}
}
proc update_MODELPARAM_VALUE.AXI_ADDR_WIDTH { MODELPARAM_VALUE.AXI_ADDR_WIDTH PARAM_VALUE.AXI_ADDR_WIDTH } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.AXI_ADDR_WIDTH}] ${MODELPARAM_VALUE.AXI_ADDR_WIDTH}
}
proc update_MODELPARAM_VALUE.STREAM_WIDTH { MODELPARAM_VALUE.STREAM_WIDTH PARAM_VALUE.STREAM_WIDTH } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.STREAM_WIDTH}] ${MODELPARAM_VALUE.STREAM_WIDTH}
}
proc update_MODELPARAM_VALUE.CMD_WIDTH { MODELPARAM_VALUE.CMD_WIDTH PARAM_VALUE.CMD_WIDTH } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.CMD_WIDTH}] ${MODELPARAM_VALUE.CMD_WIDTH}
}
proc update_MODELPARAM_VALUE.STATUS_WIDTH { MODELPARAM_VALUE.STATUS_WIDTH PARAM_VALUE.STATUS_WIDTH } {
# Procedure called to set VHDL generic/Verilog parameter value(s) based on TCL parameter value
set_property value [get_property value ${PARAM_VALUE.STATUS_WIDTH}] ${MODELPARAM_VALUE.STATUS_WIDTH}
}