First commit of the pei based project with formware tools

This commit is contained in:
David 2026-04-16 21:10:58 +01:00
commit 10459ebfc8
63 changed files with 6403 additions and 0 deletions

6
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,6 @@
{
"makefile.configureOnOpen": true,
"makefile.makePath": "make",
"makefile.makefilePath": "${workspaceFolder}/Makefile",
"makefile.makeDirectory": "${workspaceFolder}"
}

24
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,24 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "make",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run",
"type": "shell",
"command": "make run"
},
{
"label": "Clean",
"type": "shell",
"command": "make clean"
}
]
}

View file

@ -0,0 +1,36 @@
script {
// check out EL-GENERIC-IP to tag/branch specification
GIPSOURCEREPOURL = 'git@hydra:GIS_Embedded_Logic/EL-GENERIC-IP.git'
GIPSOURCEREVISION = "${GENERIC_IP_BRANCH}".trim()
GIPSOURCEDIR = "${WORKSPACE}/EL-GENERIC-IP"
GIPSOURCEROOTDIR = 'EL-GENERIC-IP'
configurationhelper.gitCheckoutAndRegister(meta, 'gip-source', GIPSOURCEREPOURL, GIPSOURCEREVISION, GIPSOURCEDIR, GIPSOURCEROOTDIR, 0, false)
// link generic_ip to local repo directory
if (isUnix()) {
sh '''
"${PYTHON}" -u "${WORKSPACE}/autobuild/synthesis/link_dirs.py" -l "${WORKSPACE}/EL-GENERIC-IP/generic_ip" -d "${WORKSPACE}/el/firmware/generic_ip"
'''
}
else {
bat '''
"%PYTHON%" -u "%WORKSPACE%\\autobuild\\synthesis\\link_dirs.py" -l "%WORKSPACE%\\EL-GENERIC-IP\\generic_ip" -d "%WORKSPACE%\\el\\firmware\\generic_ip"
'''
}
if (!isUnix()) {
// check out MinGW to tag/branch specification
MINGWSOURCEREPOURL = "${MINGW_REPO}".trim()
MINGWSOURCEREVISION = "${MINGW_BRANCH}".trim()
MINGWSOURCEDIR = "${WORKSPACE}/MinGW"
MINGWSOURCEROOTDIR = 'MinGW'
configurationhelper.gitCheckoutAndRegister(meta, 'mingw-source', MINGWSOURCEREPOURL, MINGWSOURCEREVISION, MINGWSOURCEDIR, MINGWSOURCEROOTDIR, 0, false)
env.PATH = "${WORKSPACE}\\MinGW\\bin;${WORKSPACE}\\MinGW\\msys\\1.0\\bin;${PATH}"
bat '''
"%PYTHON%" -u "%WORKSPACE%\\autobuild\\synthesis\\link_dirs.py" -i -l "%FWDEVTOOLDIR%" -d "%WORKSPACE%\\fw_development_tools"
'''
}
}

View file

@ -0,0 +1,134 @@
REM ---------------------------------------------------
REM Variables that are set externally to synthesis.bat
REM ---------------------------------------------------
@echo ----------------------------
@echo Current Error Level is %errorlevel%
REM Directories. Can be overridden by setting environment variable externally
if "%WORKSPACE%" == "" set WORKSPACE=E:\workspace\HV_1.10000_EL_synth
if "%LOCALREPO%" == "" set LOCALREPO=%cd%\..\..
if "%FWTOOLSREPO%" == "" set FWTOOLSREPO=%LOCALREPO%\..\fw_development_tools
if "%GENERICREPO%" == "" set GENERICREPO=%LOCALREPO%\..\EL-GENERIC-IP
if "%QSYS_PKG_VER%" == "" set QSYS_PKG_VER=18.1
:: Take BUILD DIR NAME from argument (if unset, will default to build in synthesis.py
set BUILD_DIR_NAME=%1
set PYTHONPATH=%FWTOOLSREPO%\logic_memory_mapper
set ISUNIX=False
REM variables used for autogeneration scripts
set AUTO_GEN_QSYS_SUFFIX=_system
:: e.g. helps to find directory containing build,doc,src etc
set AUTO_GEN_TOP_NAME=top
REM variables used for build process
set QPF_TOP=top
set QSYS_TOP=top_system
REM Set "True" to Allow unencrypted images to be created (Caution!)
set CREATE_UNENCRYPTED_RBF=true
REM Set "true" to not update generic_versioning
set PREVENT_AUTO_VERSIONING=false
REM executables
set GIT_EXECUTABLE=c:\Program Files\Git\cmd\git
if "%PYTHON%"=="" (
set PYTHON=python
)
REM Do some checks
if not exist "%LOCALREPO%" (
echo "***Error: can't find firmware repository %LOCALREPO%"
popd
exit /b 1
)
if not exist "%FWTOOLSREPO%" (
echo "***Error: can't find firmware tools repository %FWTOOLSREPO%"
popd
exit /b 1
)
if not exist "%GENERICREPO%" (
echo "***Error: can't find EL-GENERIC-IP repository %GENERICREPO%"
popd
exit /b 1
)
REM Check that the specified LOCAREPO directory is a GIT root directory
if not exist "%LOCALREPO%\.git" (
echo "***Error: directory %LOCALREPO% does not appear to be a GIT root directory"
popd
exit /b 1
)
echo ----------------------------
echo Current Error Level is %errorlevel%
REM Turn on error checking of checksynthesis.py
set RAISE_ERRORS=true
@echo ----------------------------
@echo Current Error Level is %errorlevel%
dir e:\
echo ----------------------------
echo Current Error Level is %errorlevel%
REM make sure we have a work space
if exist "%WORKSPACE%" (
echo ----------------------------
echo Current Error Level is %errorlevel%
dir
rmdir /s /q "%WORKSPACE%"
)
if errorlevel 1 (
popd
exit /b 1
)
REM Create a new workspace and change directory to it
mkdir "%WORKSPACE%"
if errorlevel 1 (
echo "***Error trying to create directory %WORKSPACE%"
popd
exit /b 1
)
set VERSION_DIR=%WORKSPACE%\version
if not exist "%VERSION_DIR%" mkdir "%VERSION_DIR%"
if errorlevel 1 exit /b 1
pushd "%WORKSPACE%"
REM set default build stamp value for local build
set BUILD_STAMP=1.30000.0.0
REM create the links from the repository like that on Jenkins servers
mklink /J a c:\altera
mklink /J el "%LOCALREPO%"
mklink /J el\firmware\generic_ip "%GENERICREPO%"\generic_ip
mklink /J jobscripts "%FWTOOLSREPO%"\autobuild\synthesis
mklink /J autogenscripts "%FWTOOLSREPO%"
if errorlevel 1 (
popd
exit /b 1
)
REM ---------------------------------------------------
REM Call the autobuild top level synthesis script
REM ---------------------------------------------------
REM Change to the scripts directory
cd jobscripts
REM Run the synthesis script that's used on Jenkins
%PYTHON% synthesis.py
if errorlevel 1 (
popd
exit /b 1
)
REM Script finished successfully
popd

View file

@ -0,0 +1,32 @@
script {
// for autogeneration scripts
env.AUTO_GEN_QSYS_SUFFIX = "_system"
// used to find directory containing build,doc,src etc
env.AUTO_GEN_TOP_NAME = "top"
//variables used for build process
env.QPF_TOP = "top"
env.QSYS_TOP = "top_system"
// Main Software
if (isUnix()) {
env.ALTERA_REPO = "git@hydra:gis/altera_18_1_linux.git"
env.ALTERA_BRANCH = "origin/master"
}
else {
env.ALTERA_REPO = "git@hydra:gis/altera_18_1.git"
env.ALTERA_BRANCH = "origin/master"
}
env.QSYS_PKG_VER = "18.1"
// Tools (tag on master)
env.FW_DEV_TOOL_BRANCH = "refs/tags/ELGIP_2021_06_24_A_DHLS"
// Generic IP
env.GENERIC_IP_BRANCH = "refs/tags/ELGIP_2021_08_25_A_DHLS"
// MinGW
env.MINGW_REPO = "git@hydra:GIS_Embedded_Logic/mingw.git"
env.MINGW_BRANCH = "origin/master"
// force extra rules for checking to permit critical warnings
env.USE_EXTRA_EXPRESSIONS="false"
// Shared Code
}

View file

@ -0,0 +1,85 @@
module altera_edge_detector #(
parameter PULSE_EXT = 0, // 0, 1 = edge detection generate single cycle pulse, >1 = pulse extended for specified clock cycle
parameter EDGE_TYPE = 0, // 0 = falling edge, 1 or else = rising edge
parameter IGNORE_RST_WHILE_BUSY = 0 // 0 = module internal reset will be default whenever rst_n asserted, 1 = rst_n request will be ignored while generating pulse out
) (
input clk,
input rst_n,
input signal_in,
output pulse_out
);
localparam IDLE = 0, ARM = 1, CAPT = 2;
localparam SIGNAL_ASSERT = EDGE_TYPE ? 1'b1 : 1'b0;
localparam SIGNAL_DEASSERT = EDGE_TYPE ? 1'b0 : 1'b1;
reg [1:0] state, next_state;
reg pulse_detect;
wire busy_pulsing;
assign busy_pulsing = (IGNORE_RST_WHILE_BUSY)? pulse_out : 1'b0;
assign reset_qual_n = rst_n | busy_pulsing;
generate
if (PULSE_EXT > 1) begin: pulse_extend
integer i;
reg [PULSE_EXT-1:0] extend_pulse;
always @(posedge clk or negedge reset_qual_n) begin
if (!reset_qual_n)
extend_pulse <= {{PULSE_EXT}{1'b0}};
else begin
for (i = 1; i < PULSE_EXT; i = i+1) begin
extend_pulse[i] <= extend_pulse[i-1];
end
extend_pulse[0] <= pulse_detect;
end
end
assign pulse_out = |extend_pulse;
end
else begin: single_pulse
reg pulse_reg;
always @(posedge clk or negedge reset_qual_n) begin
if (!reset_qual_n)
pulse_reg <= 1'b0;
else
pulse_reg <= pulse_detect;
end
assign pulse_out = pulse_reg;
end
endgenerate
always @(posedge clk) begin
if (!rst_n)
state <= IDLE;
else
state <= next_state;
end
// edge detect
always @(*) begin
next_state = state;
pulse_detect = 1'b0;
case (state)
IDLE : begin
pulse_detect = 1'b0;
if (signal_in == SIGNAL_DEASSERT) next_state = ARM;
else next_state = IDLE;
end
ARM : begin
pulse_detect = 1'b0;
if (signal_in == SIGNAL_ASSERT) next_state = CAPT;
else next_state = ARM;
end
CAPT : begin
pulse_detect = 1'b1;
if (signal_in == SIGNAL_DEASSERT) next_state = ARM;
else next_state = IDLE;
end
default : begin
pulse_detect = 1'b0;
next_state = IDLE;
end
endcase
end
endmodule

View file

@ -0,0 +1,74 @@
//Legal Notice: (C)2013 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated documentation or information are
//expressly subject to the terms and conditions of the Altera Program
//License Subscription Agreement or other applicable license agreement,
//including, without limitation, that your use is for the sole purpose
//of programming logic devices manufactured by Altera and sold by Altera
//or its authorized distributors. Please refer to the applicable
//agreement for further details.
module debounce (
clk,
reset_n,
data_in,
data_out
);
parameter WIDTH = 32; // set to be the width of the bus being debounced
parameter POLARITY = "HIGH"; // set to be "HIGH" for active high debounce or "LOW" for active low debounce
parameter TIMEOUT = 50000; // number of input clock cycles the input signal needs to be in the active state
parameter TIMEOUT_WIDTH = 16; // set to be ceil(log2(TIMEOUT))
input wire clk;
input wire reset_n;
input wire [WIDTH-1:0] data_in;
output wire [WIDTH-1:0] data_out;
reg [TIMEOUT_WIDTH-1:0] counter [0:WIDTH-1];
wire counter_reset [0:WIDTH-1];
wire counter_enable [0:WIDTH-1];
// need one counter per input to debounce
genvar i;
generate for (i = 0; i < WIDTH; i = i+1)
begin: debounce_counter_loop
always @ (posedge clk or negedge reset_n)
begin
if (reset_n == 0)
begin
counter[i] <= 0;
end
else
begin
if (counter_reset[i] == 1) // resetting the counter needs to win
begin
counter[i] <= 0;
end
else if (counter_enable[i] == 1)
begin
counter[i] <= counter[i] + 1'b1;
end
end
end
if (POLARITY == "HIGH")
begin
assign counter_reset[i] = (data_in[i] == 0);
assign counter_enable[i] = (data_in[i] == 1) & (counter[i] < TIMEOUT);
assign data_out[i] = (counter[i] == TIMEOUT) ? 1'b1 : 1'b0;
end
else
begin
assign counter_reset[i] = (data_in[i] == 1);
assign counter_enable[i] = (data_in[i] == 0) & (counter[i] < TIMEOUT);
assign data_out[i] = (counter[i] == TIMEOUT) ? 1'b0 : 1'b1;
end
end
endgenerate
endmodule

View file

@ -0,0 +1,5 @@
set_global_assignment -name IP_TOOL_NAME "In-System Sources and Probes"
set_global_assignment -name IP_TOOL_VERSION "16.0"
set_global_assignment -name IP_GENERATED_DEVICE_FAMILY "{Cyclone V}"
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) "hps_reset.v"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "hps_reset_bb.v"]

View file

@ -0,0 +1,111 @@
// megafunction wizard: %In-System Sources and Probes%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsource_probe
// ============================================================
// File Name: hps_reset.v
// Megafunction Name(s):
// altsource_probe
//
// Simulation Library Files(s):
//
// ============================================================
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
//
// 16.0.0 Build 211 04/27/2016 SJ Lite Edition
// ************************************************************
//Copyright (C) 1991-2016 Altera Corporation. All rights reserved.
//Your use of Altera Corporation's design tools, logic functions
//and other software and tools, and its AMPP partner logic
//functions, and any output files from any of the foregoing
//(including device programming or simulation files), and any
//associated documentation or information are expressly subject
//to the terms and conditions of the Altera Program License
//Subscription Agreement, the Altera Quartus Prime License Agreement,
//the Altera MegaCore Function License Agreement, or other
//applicable license agreement, including, without limitation,
//that your use is for the sole purpose of programming logic
//devices manufactured by Altera and sold by Altera or its
//authorized distributors. Please refer to the applicable
//agreement for further details.
// synopsys translate_off
`timescale 1 ps / 1 ps
// synopsys translate_on
module hps_reset (
probe,
source_clk,
source);
input probe;
input source_clk;
output [2:0] source;
wire [2:0] sub_wire0;
wire [2:0] source = sub_wire0[2:0];
altsource_probe altsource_probe_component (
.probe (probe),
.source_clk (source_clk),
.source (sub_wire0)
// synopsys translate_off
,
.clr (),
.ena (),
.ir_in (),
.ir_out (),
.jtag_state_cdr (),
.jtag_state_cir (),
.jtag_state_e1dr (),
.jtag_state_sdr (),
.jtag_state_tlr (),
.jtag_state_udr (),
.jtag_state_uir (),
.raw_tck (),
.source_ena (),
.tdi (),
.tdo (),
.usr1 ()
// synopsys translate_on
);
defparam
altsource_probe_component.enable_metastability = "YES",
altsource_probe_component.instance_id = "RST",
altsource_probe_component.probe_width = 0,
altsource_probe_component.sld_auto_instance_index = "YES",
altsource_probe_component.sld_instance_index = 0,
altsource_probe_component.source_initial_value = " 0",
altsource_probe_component.source_width = 3;
endmodule
// ============================================================
// CNX file retrieval info
// ============================================================
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone V"
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
// Retrieval info: CONSTANT: ENABLE_METASTABILITY STRING "YES"
// Retrieval info: CONSTANT: INSTANCE_ID STRING "RST"
// Retrieval info: CONSTANT: PROBE_WIDTH NUMERIC "0"
// Retrieval info: CONSTANT: SLD_AUTO_INSTANCE_INDEX STRING "YES"
// Retrieval info: CONSTANT: SLD_INSTANCE_INDEX NUMERIC "0"
// Retrieval info: CONSTANT: SOURCE_INITIAL_VALUE STRING " 0"
// Retrieval info: CONSTANT: SOURCE_WIDTH NUMERIC "3"
// Retrieval info: USED_PORT: probe 0 0 0 0 INPUT NODEFVAL "probe"
// Retrieval info: USED_PORT: source 0 0 3 0 OUTPUT NODEFVAL "source[2..0]"
// Retrieval info: USED_PORT: source_clk 0 0 0 0 INPUT NODEFVAL "source_clk"
// Retrieval info: CONNECT: @probe 0 0 0 0 probe 0 0 0 0
// Retrieval info: CONNECT: @source_clk 0 0 0 0 source_clk 0 0 0 0
// Retrieval info: CONNECT: source 0 0 3 0 @source 0 0 3 0
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.inc FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.cmp FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.bsf FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset_inst.v FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset_bb.v TRUE

View file

@ -0,0 +1,69 @@
// megafunction wizard: %In-System Sources and Probes%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsource_probe
// ============================================================
// File Name: hps_reset.v
// Megafunction Name(s):
// altsource_probe
//
// Simulation Library Files(s):
//
// ============================================================
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
//
// 16.0.0 Build 211 04/27/2016 SJ Lite Edition
// ************************************************************
//Copyright (C) 1991-2016 Altera Corporation. All rights reserved.
//Your use of Altera Corporation's design tools, logic functions
//and other software and tools, and its AMPP partner logic
//functions, and any output files from any of the foregoing
//(including device programming or simulation files), and any
//associated documentation or information are expressly subject
//to the terms and conditions of the Altera Program License
//Subscription Agreement, the Altera Quartus Prime License Agreement,
//the Altera MegaCore Function License Agreement, or other
//applicable license agreement, including, without limitation,
//that your use is for the sole purpose of programming logic
//devices manufactured by Altera and sold by Altera or its
//authorized distributors. Please refer to the applicable
//agreement for further details.
module hps_reset (
probe,
source_clk,
source);
input probe;
input source_clk;
output [2:0] source;
endmodule
// ============================================================
// CNX file retrieval info
// ============================================================
// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone V"
// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
// Retrieval info: CONSTANT: ENABLE_METASTABILITY STRING "YES"
// Retrieval info: CONSTANT: INSTANCE_ID STRING "RST"
// Retrieval info: CONSTANT: PROBE_WIDTH NUMERIC "0"
// Retrieval info: CONSTANT: SLD_AUTO_INSTANCE_INDEX STRING "YES"
// Retrieval info: CONSTANT: SLD_INSTANCE_INDEX NUMERIC "0"
// Retrieval info: CONSTANT: SOURCE_INITIAL_VALUE STRING " 0"
// Retrieval info: CONSTANT: SOURCE_WIDTH NUMERIC "3"
// Retrieval info: USED_PORT: probe 0 0 0 0 INPUT NODEFVAL "probe"
// Retrieval info: USED_PORT: source 0 0 3 0 OUTPUT NODEFVAL "source[2..0]"
// Retrieval info: USED_PORT: source_clk 0 0 0 0 INPUT NODEFVAL "source_clk"
// Retrieval info: CONNECT: @probe 0 0 0 0 probe 0 0 0 0
// Retrieval info: CONNECT: @source_clk 0 0 0 0 source_clk 0 0 0 0
// Retrieval info: CONNECT: source 0 0 3 0 @source 0 0 3 0
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.v TRUE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.inc FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.cmp FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset.bsf FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset_inst.v FALSE
// Retrieval info: GEN_FILE: TYPE_NORMAL hps_reset_bb.v TRUE

View file

@ -0,0 +1,61 @@
//Legal Notice: (C)2013 Altera Corporation. All rights reserved. Your
//use of Altera Corporation's design tools, logic functions and other
//software and tools, and its AMPP partner logic functions, and any
//output files any of the foregoing (including device programming or
//simulation files), and any associated documentation or information are
//expressly subject to the terms and conditions of the Altera Program
//License Subscription Agreement or other applicable license agreement,
//including, without limitation, that your use is for the sole purpose
//of programming logic devices manufactured by Altera and sold by Altera
//or its authorized distributors. Please refer to the applicable
//agreement for further details.
module intr_capturer #(
parameter NUM_INTR = 32
// active high level interrupt is expected for the input of this capturer module
)(
input clk,
input rst_n,
input [NUM_INTR-1:0] interrupt_in,
//input [31:0] wrdata,
input addr,
input read,
output [31:0] rddata
);
reg [NUM_INTR-1:0] interrupt_reg;
reg [31:0] readdata_with_waitstate;
wire [31:0] act_readdata;
wire [31:0] readdata_lower_intr;
wire [31:0] readdata_higher_intr;
wire access_lower_32;
wire access_higher_32;
always @(posedge clk or negedge rst_n) begin
if (!rst_n) interrupt_reg <= 'b0;
else interrupt_reg <= interrupt_in;
end
generate
if (NUM_INTR>32) begin : two_intr_reg_needed
assign access_higher_32 = read & (addr == 1);
assign readdata_lower_intr = interrupt_reg[31:0] & {(32){access_lower_32}};
assign readdata_higher_intr = interrupt_reg[NUM_INTR-1:32] & {(NUM_INTR-32){access_higher_32}};
end
else begin : only_1_reg
assign readdata_lower_intr = interrupt_reg & {(NUM_INTR){access_lower_32}};
assign readdata_higher_intr = {32{1'b0}};
end
endgenerate
assign access_lower_32 = read & (addr == 0);
assign act_readdata = readdata_lower_intr | readdata_higher_intr;
assign rddata = readdata_with_waitstate;
always @(posedge clk or negedge rst_n) begin
if (!rst_n) readdata_with_waitstate <= 32'b0;
else readdata_with_waitstate <= act_readdata;
end
endmodule

View file

@ -0,0 +1,160 @@
# TCL File Generated by Component Editor 13.0
# Mon Dec 10 18:37:36 MYT 2012
# DO NOT MODIFY
#
# intr_capturer "Interrupt Capture Module" v1.0
# Altera Corporation 2012.12.10.18:37:36
# This component capture interrupt inputs and presents them as registers readable via Avalon Slave port
#
#
# request TCL package from ACDS 13.0
#
package require -exact qsys 13.0
#
# module intr_capturer
#
set_module_property DESCRIPTION "This component capture interrupt inputs and presents them as registers readable via Avalon Slave port"
set_module_property NAME intr_capturer
set_module_property VERSION __VERSION_SHORT__
set_module_property INTERNAL false
set_module_property OPAQUE_ADDRESS_MAP true
set_module_property GROUP Other
set_module_property AUTHOR "Altera Corporation"
set_module_property DISPLAY_NAME "Interrupt Capture Module"
set_module_property INSTANTIATE_IN_SYSTEM_MODULE true
set_module_property EDITABLE true
set_module_property ANALYZE_HDL AUTO
set_module_property REPORT_TO_TALKBACK false
set_module_property ALLOW_GREYBOX_GENERATION false
#
# file sets
#
add_fileset QUARTUS_SYNTH QUARTUS_SYNTH "" ""
set_fileset_property QUARTUS_SYNTH TOP_LEVEL intr_capturer
set_fileset_property QUARTUS_SYNTH ENABLE_RELATIVE_INCLUDE_PATHS false
add_fileset_file intr_capturer.v VERILOG PATH intr_capturer.v
add_fileset SIM_VERILOG SIM_VERILOG "" ""
set_fileset_property SIM_VERILOG TOP_LEVEL intr_capturer
set_fileset_property SIM_VERILOG ENABLE_RELATIVE_INCLUDE_PATHS false
add_fileset_file intr_capturer.v VERILOG PATH intr_capturer.v
add_fileset SIM_VHDL SIM_VHDL vhdl_from_verilog
set_fileset_property SIM_VHDL top_level intr_capturer
proc vhdl_from_verilog { outputName } {
set fileloc [create_temp_file simgen_init.txt]
send_message info ${fileloc}
set fileHandle [ open ${fileloc} w ]
puts ${fileHandle} "DECLARE_VHDL_COMPONENT=timmy\n"
close ${fileHandle}
set SIMGEN_PARAMS "--simgen_parameter=CBX_HDL_LANGUAGE=VHDL,SIMGEN_RAND_POWERUP_FFS=OFF,SIMGEN_OBFUSCATE=OFF,SIMGEN_MAX_TULIP_COUNT=0,SIMGEN_INITIALIZATION_FILE=${fileloc},SIMGEN_VHDL_LIBRARY_LIST=work"
set foo [call_simgen intr_capturer.v "$SIMGEN_PARAMS --simgen_arbitrary_blackbox=+timmy" ]
set foo "${foo}.vho"
#set foo [simgen_file bob.v bob VHDL {tom.v timmy.v} +timmy ${fileloc} work ]
add_fileset_file intr_capturer.vho VHDL PATH ${foo}
#add_fileset_file timmy.vhd VHDL PATH timmy.vhd
}
#
# parameters
#
add_parameter NUM_INTR INTEGER 32
set_parameter_property NUM_INTR DEFAULT_VALUE 32
set_parameter_property NUM_INTR DISPLAY_NAME NUM_INTR
set_parameter_property NUM_INTR TYPE INTEGER
set_parameter_property NUM_INTR UNITS None
set_parameter_property NUM_INTR ALLOWED_RANGES 1:64
set_parameter_property NUM_INTR HDL_PARAMETER true
#
# display items
#
#
# connection point clock
#
add_interface clock clock end
set_interface_property clock clockRate 0
set_interface_property clock ENABLED true
set_interface_property clock EXPORT_OF ""
set_interface_property clock PORT_NAME_MAP ""
set_interface_property clock SVD_ADDRESS_GROUP ""
add_interface_port clock clk clk Input 1
#
# connection point reset_sink
#
add_interface reset_sink reset end
set_interface_property reset_sink associatedClock clock
set_interface_property reset_sink synchronousEdges DEASSERT
set_interface_property reset_sink ENABLED true
set_interface_property reset_sink EXPORT_OF ""
set_interface_property reset_sink PORT_NAME_MAP ""
set_interface_property reset_sink SVD_ADDRESS_GROUP ""
add_interface_port reset_sink rst_n reset_n Input 1
#
# connection point avalon_slave_0
#
add_interface avalon_slave_0 avalon end
set_interface_property avalon_slave_0 addressUnits WORDS
set_interface_property avalon_slave_0 associatedClock clock
set_interface_property avalon_slave_0 associatedReset reset_sink
set_interface_property avalon_slave_0 bitsPerSymbol 8
set_interface_property avalon_slave_0 burstOnBurstBoundariesOnly false
set_interface_property avalon_slave_0 burstcountUnits WORDS
set_interface_property avalon_slave_0 explicitAddressSpan 0
set_interface_property avalon_slave_0 holdTime 0
set_interface_property avalon_slave_0 linewrapBursts false
set_interface_property avalon_slave_0 maximumPendingReadTransactions 0
set_interface_property avalon_slave_0 readLatency 0
set_interface_property avalon_slave_0 readWaitTime 1
set_interface_property avalon_slave_0 setupTime 0
set_interface_property avalon_slave_0 timingUnits Cycles
set_interface_property avalon_slave_0 writeWaitTime 0
set_interface_property avalon_slave_0 ENABLED true
set_interface_property avalon_slave_0 EXPORT_OF ""
set_interface_property avalon_slave_0 PORT_NAME_MAP ""
set_interface_property avalon_slave_0 SVD_ADDRESS_GROUP ""
add_interface_port avalon_slave_0 addr address Input 1
add_interface_port avalon_slave_0 read read Input 1
add_interface_port avalon_slave_0 rddata readdata Output 32
set_interface_assignment avalon_slave_0 embeddedsw.configuration.isFlash 0
set_interface_assignment avalon_slave_0 embeddedsw.configuration.isMemoryDevice 0
set_interface_assignment avalon_slave_0 embeddedsw.configuration.isNonVolatileStorage 0
set_interface_assignment avalon_slave_0 embeddedsw.configuration.isPrintableDevice 0
#
# connection point interrupt_receiver
#
add_interface interrupt_receiver interrupt start
set_interface_property interrupt_receiver associatedAddressablePoint ""
set_interface_property interrupt_receiver associatedClock clock
set_interface_property interrupt_receiver associatedReset reset_sink
set_interface_property interrupt_receiver irqScheme INDIVIDUAL_REQUESTS
set_interface_property interrupt_receiver ENABLED true
set_interface_property interrupt_receiver EXPORT_OF ""
set_interface_property interrupt_receiver PORT_NAME_MAP ""
set_interface_property interrupt_receiver SVD_ADDRESS_GROUP ""
add_interface_port interrupt_receiver interrupt_in irq Input NUM_INTR

View file

@ -0,0 +1,165 @@
-------------------------------------------------------------------------------
-- Title : constant_latency_if
-- Project : HMB/EMB/SMB
-------------------------------------------------------------------------------
-- File : constant_latency_if
-- Author : Christos Spirotis
-- Company : Global Inkjet Systems
-- Created : 2019-07-24
-- Last update: 2019-07-24
-- SVN ID : Git
-- Standard : VHDL'08
-------------------------------------------------------------------------------
-- Description:
-- Used to interface blocks with variable latency to a fixed waitstate
-- avalon bus
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity constant_latency_if is
generic(
READ_WAIT : integer range 0 to 7 := 4;
WRITE_WAIT : integer range 0 to 7 := 1
);
port(
reset_n : in std_logic;
clk : in std_logic;
avs_var_lat_req : in std_logic;
avs_var_lat_err : out std_logic;
-- Avalon MM (Slave) Interface
avs_sl_address : in std_logic_vector(15 downto 0);
avs_sl_write : in std_logic;
avs_sl_writedata : in std_logic_vector(31 downto 0);
avs_sl_read : in std_logic;
avs_sl_readdata : out std_logic_vector(31 downto 0);
-- Avalon MM (Master) Interface
avs_ms_address : out std_logic_vector(15 downto 0);
avs_ms_write : out std_logic;
avs_ms_writedata : out std_logic_vector(31 downto 0);
avs_ms_read : out std_logic;
avs_ms_readdata : in std_logic_vector(31 downto 0);
avs_ms_waitrequest : in std_logic
);
end entity constant_latency_if;
architecture rtl of constant_latency_if is
signal short_access : std_logic;
signal busy : std_logic;
signal cycle_cnt : integer range 0 to 7;
signal readdata : std_logic_vector(31 downto 0);
signal waitrequest_rx : std_logic;
signal access_finished : std_logic;
begin
-- Drive address to master
avs_ms_address <= avs_sl_address;
-- Drive write to master but masked
avs_ms_write <= avs_sl_write and not (access_finished);
-- Drive read to master but masked
avs_ms_read <= avs_sl_read and not (access_finished);
-- Drive writedata to master
avs_ms_writedata <= avs_sl_writedata;
-- Drive readdata to slave
avs_sl_readdata <= readdata when (short_access = '1' or waitrequest_rx = '1') else avs_ms_readdata;
-- This process handles the reads/writes
rw_handler_pr : process (clk, reset_n)
begin
if reset_n = '0' then
avs_var_lat_err <= '0';
readdata <= (others => '0');
short_access <= '0';
busy <= '0';
cycle_cnt <= 0;
waitrequest_rx <= '0';
access_finished <= '0';
elsif rising_edge(clk) then
-- Reset error pulse
avs_var_lat_err <= '0';
-- Idle
if busy = '0' then
-- Detect write with no latency required
if avs_sl_write = '1' and avs_var_lat_req = '0' then
busy <= '1';
-- Shorten the access cycle
short_access <= '1';
access_finished <= '1';
cycle_cnt <= WRITE_WAIT;
end if;
-- Detect read witn no latency required
if avs_sl_read = '1' and avs_var_lat_req = '0' then
busy <= '1';
-- Shorten the access cycle
short_access <= '1';
access_finished <= '1';
cycle_cnt <= READ_WAIT;
end if;
-- Detect write with var latency required
if avs_sl_write = '1' and avs_var_lat_req = '1' then
busy <= '1';
cycle_cnt <= WRITE_WAIT;
waitrequest_rx <= '0';
access_finished <= '0';
end if;
-- Detect read with var latency required
if avs_sl_read = '1' and avs_var_lat_req = '1' then
busy <= '1';
cycle_cnt <= READ_WAIT;
waitrequest_rx <= '0';
access_finished <= '0';
end if;
end if;
-- During transfer
if busy = '1' then
-- Store the data returned after a short cycle read
if short_access = '1' and avs_sl_read = '1' and cycle_cnt = READ_WAIT then
readdata <= avs_ms_readdata;
end if;
-- Store the data returned after a variable cycle read
if short_access = '0' and avs_sl_read = '1' and avs_ms_waitrequest = '0' then
readdata <= avs_ms_readdata;
end if;
-- Detect waitrequest assertion
if short_access = '0' and avs_ms_waitrequest = '0' then
waitrequest_rx <= '1';
access_finished <= '1';
end if;
-- Countdown the waitstates
if cycle_cnt /= 1 then
cycle_cnt <= cycle_cnt - 1;
-- Finish cycle at the end of the waitstates
else
-- Detect that waitrequest was not asserted properly within specified time
if avs_var_lat_req = '1' and waitrequest_rx = '0' and avs_ms_waitrequest = '1' then
avs_var_lat_err <= '1';
end if;
cycle_cnt <= 0;
busy <= '0';
short_access <= '0';
waitrequest_rx <= '0';
access_finished <= '0';
end if;
end if;
end if;
end process rw_handler_pr;
end architecture rtl;

1114
firmware/top/src/core.vhd Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,685 @@
# TCL File Generated by Component Editor 18.1
# Fri Oct 18 11:11:20 BST 2019
# DO NOT MODIFY
#
# core "core" v1.0
# 2019.10.18.11:11:20
#
#
#
# request TCL package from ACDS 16.1
#
package require -exact qsys 16.1
#
# module core
#
set_module_property DESCRIPTION ""
set_module_property NAME core
set_module_property VERSION 1.0
set_module_property INTERNAL false
set_module_property OPAQUE_ADDRESS_MAP true
set_module_property AUTHOR ""
set_module_property DISPLAY_NAME core
set_module_property INSTANTIATE_IN_SYSTEM_MODULE true
set_module_property EDITABLE true
set_module_property REPORT_TO_TALKBACK false
set_module_property ALLOW_GREYBOX_GENERATION false
set_module_property REPORT_HIERARCHY false
#
# file sets
#
add_fileset QUARTUS_SYNTH QUARTUS_SYNTH "" ""
set_fileset_property QUARTUS_SYNTH TOP_LEVEL core
set_fileset_property QUARTUS_SYNTH ENABLE_RELATIVE_INCLUDE_PATHS false
set_fileset_property QUARTUS_SYNTH ENABLE_FILE_OVERWRITE_MODE false
add_fileset_file altera_up_rs232_counters_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_counters_3.v
add_fileset_file altera_up_sync_fifo_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/altera_up_sync_fifo_3.v
add_fileset_file altera_up_rs232_in_deserializer_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_in_deserializer_3.v
add_fileset_file altera_up_rs232_out_serializer_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_out_serializer_3.v
add_fileset_file uart_1MBd_rs232_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/uart_1MBd_rs232_3.v
add_fileset_file uart_1MBd_3_pkg_auto.vhd VHDL PATH ../../generic_ip/uart_1MBd/3/src/uart_1MBd_3_pkg_auto.vhd
add_fileset_file uart_1MBd_3_csr_regs_auto.vhd VHDL PATH ../../generic_ip/uart_1MBd/3/src/uart_1MBd_3_csr_regs_auto.vhd
add_fileset_file uart_1MBd_3.vhd VHDL PATH ../../generic_ip/uart_1MBd/3/src/uart_1MBd_3.vhd
add_fileset_file common_pkg.vhd VHDL PATH ../../generic_ip/common/0/src/common_pkg.vhd
add_fileset_file pkg_functions.vhd VHDL PATH ../../generic_ip/common/0/src/pkg_functions.vhd
add_fileset_file markov_edges.vhd VHDL PATH ../../generic_ip/common/0/src/markov_edges.vhd
add_fileset_file sync_reset.vhd VHDL PATH ../../generic_ip/common/0/src/sync_reset.vhd
add_fileset_file alt_dp_ram.vhd VHDL PATH ../../generic_ip/common/0/src/altera/alt_dp_ram.vhd
add_fileset_file alt_rw_dp_ram.vhd VHDL PATH ../../generic_ip/common/0/src/altera/alt_rw_dp_ram.vhd
add_fileset_file alt_sync_fifo.vhd VHDL PATH ../../generic_ip/common/0/src/altera/alt_sync_fifo.vhd
add_fileset_file ddr_tx_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/altera/ddr_tx_1.vhd
add_fileset_file lvds_ddr_tx_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/altera/lvds_ddr_tx_1.vhd
add_fileset_file lvds_pio_tx_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/altera/lvds_pio_tx_1.vhd
add_fileset_file lvds_serdes_tx_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/altera/lvds_serdes_tx_1.vhd
add_fileset_file generic_pio_1_pkg_auto.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/generic_pio_1_pkg_auto.vhd
add_fileset_file generic_pio_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/generic_pio_1.vhd
add_fileset_file swim_2_pkg_auto.vhd VHDL PATH ../../generic_ip/swim/2/src/swim_2_pkg_auto.vhd
add_fileset_file swim_2_csr_regs_auto.vhd VHDL PATH ../../generic_ip/swim/2/src/swim_2_csr_regs_auto.vhd
add_fileset_file swim_2.vhd VHDL PATH ../../generic_ip/swim/2/src/swim_2.vhd
add_fileset_file dp_mem_5.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/altera/dp_mem_5.vhd
add_fileset_file hmb_fpga_cfg_5_pkg_auto.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/hmb_fpga_cfg_5_pkg_auto.vhd
add_fileset_file hmb_fpga_cfg_5_csr_regs_auto.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/hmb_fpga_cfg_5_csr_regs_auto.vhd
add_fileset_file hmb_fpga_cfg_5.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/hmb_fpga_cfg_5.vhd
add_fileset_file generic_sequencer_15_pkg.vhd VHDL PATH ../../generic_ip/generic_sequencer/15/src/generic_sequencer_15_pkg.vhd
add_fileset_file generic_seq_ram_15.vhd VHDL PATH ../../generic_ip/generic_sequencer/15/src/altera/generic_seq_ram_15.vhd
add_fileset_file generic_sequencer_15.vhd VHDL PATH ../../generic_ip/generic_sequencer/15/src/generic_sequencer_15.vhd
add_fileset_file generic_delay_queue_1_pkg_auto.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/generic_delay_queue_1_pkg_auto.vhd
add_fileset_file fifo_delay_queue_1_ff.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/altera/fifo_delay_queue_1_ff.vhd
add_fileset_file fifo_delay_queue_1.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/altera/fifo_delay_queue_1.vhd
add_fileset_file generic_delay_queue_1_csr_regs_auto.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/generic_delay_queue_1_csr_regs_auto.vhd
add_fileset_file generic_delay_queue_1.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/generic_delay_queue_1.vhd
add_fileset_file pulse_generator_2_pkg.vhd VHDL PATH ../../generic_ip/pulse_generator/2/src/pulse_generator_2_pkg.vhd
add_fileset_file sync_fifo.vhd VHDL PATH ../../generic_ip/common/0/src/altera/sync_fifo.vhd
add_fileset_file dpram_sclk.vhd VHDL PATH ../../generic_ip/common/0/src/dpram_sclk.vhd
add_fileset_file pulse_conditioning_2.vhd VHDL PATH ../../generic_ip/pulse_generator/2/src/pulse_conditioning_2.vhd
add_fileset_file queue_and_delay.vhd VHDL PATH ../../generic_ip/common/0/src/queue_and_delay.vhd
add_fileset_file simple_frac_div_2.vhd VHDL PATH ../../generic_ip/pulse_generator/2/src/simple_frac_div_2.vhd
add_fileset_file pulse_generator_2.vhd VHDL PATH ../../generic_ip/pulse_generator/2/src/pulse_generator_2.vhd
add_fileset_file enc_pd_emul_1_pkg.vhd VHDL PATH ../../generic_ip/enc_pd_emul/1/src/enc_pd_emul_1_pkg.vhd
add_fileset_file enc_pd_emul_1.vhd VHDL PATH ../../generic_ip/enc_pd_emul/1/src/enc_pd_emul_1.vhd
add_fileset_file preslicer_fifo_0.vhd VHDL PATH ../../generic_ip/preslicer/0/src/altera/preslicer_fifo_0.vhd
add_fileset_file preslicer_0.vhd VHDL PATH ../../generic_ip/preslicer/0/src/preslicer_0.vhd
add_fileset_file pixel_buffer_0_pkg.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/pixel_buffer_0_pkg.vhd
add_fileset_file pixel_ram_0.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/altera/pixel_ram_0.vhd
add_fileset_file pixel_buffer_0.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/pixel_buffer_0.vhd
add_fileset_file gl_remap.vhd VHDL PATH ../../data_core/src/gl_remap.vhd
add_fileset_file slicer.vhd VHDL PATH ../../data_core/src/slicer.vhd
add_fileset_file data_core.vhd VHDL PATH ../../data_core/src/data_core.vhd
add_fileset_file print_unit_pkg_auto.vhd VHDL PATH ../../print_unit/src/print_unit_pkg_auto.vhd
add_fileset_file print_unit_csr_decode_auto.vhd VHDL PATH ../../print_unit/src/print_unit_csr_decode_auto.vhd
add_fileset_file print_unit_seq_decode_auto.vhd VHDL PATH ../../print_unit/src/print_unit_seq_decode_auto.vhd
add_fileset_file print_unit.vhd VHDL PATH ../../print_unit/src/print_unit.vhd
add_fileset_file cmd_queue_7.vhd VHDL PATH ../../generic_ip/data_streamer/7/src/altera/cmd_queue_7.vhd
add_fileset_file tlb_queue_7.vhd VHDL PATH ../../generic_ip/data_streamer/7/src/altera/tlb_queue_7.vhd
add_fileset_file data_streamer_7.vhd VHDL PATH ../../generic_ip/data_streamer/7/src/data_streamer_7.vhd
add_fileset_file print_streamer_pkg_auto.vhd VHDL PATH ../../print_streamer/src/print_streamer_pkg_auto.vhd
add_fileset_file data_streamer_pkg_auto.vhd VHDL PATH ../../print_streamer/src/data_streamer_pkg_auto.vhd
add_fileset_file avm_to_axi_master.vhd VHDL PATH ../../print_streamer/src/avm_to_axi_master.vhd
add_fileset_file data_streamer_csr_regs_auto.vhd VHDL PATH ../../print_streamer/src/data_streamer_csr_regs_auto.vhd
add_fileset_file print_streamer_csr_decode_auto.vhd VHDL PATH ../../print_streamer/src/print_streamer_csr_decode_auto.vhd
add_fileset_file mem_arbiter.vhd VHDL PATH ../../print_streamer/src/mem_arbiter.vhd
add_fileset_file streamer_queue_0.vhd VHDL PATH ../../generic_ip/streamer_fifo/0/src/altera/streamer_queue_0.vhd
add_fileset_file streamer_fifo_0.vhd VHDL PATH ../../generic_ip/streamer_fifo/0/src/streamer_fifo_0.vhd
add_fileset_file print_streamer.vhd VHDL PATH ../../print_streamer/src/print_streamer.vhd
add_fileset_file dac_interface.vhd VHDL PATH ../../print_ctrl/src/dac_interface.vhd
add_fileset_file print_ctrl_csr_decode_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_csr_decode_auto.vhd
add_fileset_file print_ctrl_seq_decode_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_seq_decode_auto.vhd
add_fileset_file print_ctrl_pkg_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_pkg_auto.vhd
add_fileset_file print_ctrl_csr_regs_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_csr_regs_auto.vhd
add_fileset_file print_ctrl.vhd VHDL PATH ../../print_ctrl/src/print_ctrl.vhd
add_fileset_file shutdown_monitor_0_pkg_auto.vhd VHDL PATH ../../generic_ip/shutdown_monitor/0/src/shutdown_monitor_0_pkg_auto.vhd
add_fileset_file shutdown_monitor_0_csr_regs_auto.vhd VHDL PATH ../../generic_ip/shutdown_monitor/0/src/shutdown_monitor_0_csr_regs_auto.vhd
add_fileset_file shutdown_monitor_0.vhd VHDL PATH ../../generic_ip/shutdown_monitor/0/src/shutdown_monitor_0.vhd
add_fileset_file lvds_rx_1ck_16d.vhd VHDL PATH ../../hmb_fpga_top/build/ip/lvds_rx_1ck_16d.vhd
add_fileset_file pwm.vhd VHDL PATH ../../pwm/src/pwm.vhd
add_fileset_file freq_counter.vhd VHDL PATH ../../freq_counter/src/freq_counter.vhd
add_fileset_file constant_latency_if.vhd VHDL PATH constant_latency_if.vhd
add_fileset_file cs_bus_itf.vhd VHDL PATH ../../generic_ip/common/0/src/cs_bus_itf.vhd
add_fileset_file sync_wire.vhd VHDL PATH ../../generic_ip/common/0/src/sync_wire.vhd
add_fileset_file sync_wire_rEdge.vhd VHDL PATH ../../generic_ip/common/0/src/sync_wire_rEdge.vhd
add_fileset_file uart_rx.vhd VHDL PATH ../../generic_ip/common/0/src/uart_rx.vhd
add_fileset_file pof_uart_rx_0.vhd VHDL PATH ../../generic_ip/pof_protocol/0/src/pof_uart_rx_0.vhd
add_fileset_file pof_rx_0.vhd VHDL PATH ../../generic_ip/pof_protocol/0/src/pof_rx_0.vhd
add_fileset_file pof_uart_regen_0.vhd VHDL PATH ../../generic_ip/pof_protocol/0/src/pof_uart_regen_0.vhd
add_fileset_file pof_uart_rx_1.vhd VHDL PATH ../../generic_ip/pof_protocol/1/src/pof_uart_rx_1.vhd
add_fileset_file pof_rx_1.vhd VHDL PATH ../../generic_ip/pof_protocol/1/src/pof_rx_1.vhd
add_fileset_file pof_uart_regen_1.vhd VHDL PATH ../../generic_ip/pof_protocol/1/src/pof_uart_regen_1.vhd
add_fileset_file event_logger_0_pkg.vhd VHDL PATH ../../generic_ip/event_logger/0/src/event_logger_0_pkg.vhd
add_fileset_file event_logger_0.vhd VHDL PATH ../../generic_ip/event_logger/0/src/event_logger_0.vhd
add_fileset_file simple_enc_vel_detect_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/simple_enc_vel_detect_4.vhd
add_fileset_file smb_diagnostics_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/smb_diagnostics_4.vhd
add_fileset_file fire_pulse_4_pkg.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_4_pkg.vhd
add_fileset_file fire_pulse_ctrl_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_ctrl_4.vhd
add_fileset_file fire_pulse_ext_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_ext_4.vhd
add_fileset_file fire_pulse_manager_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_manager_4.vhd
add_fileset_file top_pkg.vhd VHDL PATH top_pkg.vhd
add_fileset_file core_pkg_auto.vhd VHDL PATH core_pkg_auto.vhd
add_fileset_file core_csr_decode_auto.vhd VHDL PATH core_csr_decode_auto.vhd
add_fileset_file core_csr_regs_auto.vhd VHDL PATH core_csr_regs_auto.vhd
add_fileset_file core_seq_decode_auto.vhd VHDL PATH core_seq_decode_auto.vhd
add_fileset_file core.vhd VHDL PATH core.vhd TOP_LEVEL_FILE
#
# parameters
#
add_parameter MAX_HEADS INTEGER 4
set_parameter_property MAX_HEADS DEFAULT_VALUE 4
set_parameter_property MAX_HEADS DISPLAY_NAME MAX_HEADS
set_parameter_property MAX_HEADS TYPE INTEGER
set_parameter_property MAX_HEADS UNITS None
set_parameter_property MAX_HEADS ALLOWED_RANGES -2147483648:2147483647
set_parameter_property MAX_HEADS HDL_PARAMETER true
add_parameter NUM_HEADS INTEGER 4
set_parameter_property NUM_HEADS DEFAULT_VALUE 4
set_parameter_property NUM_HEADS DISPLAY_NAME NUM_HEADS
set_parameter_property NUM_HEADS TYPE INTEGER
set_parameter_property NUM_HEADS UNITS None
set_parameter_property NUM_HEADS ALLOWED_RANGES -2147483648:2147483647
set_parameter_property NUM_HEADS HDL_PARAMETER true
add_parameter TRIGGER_WIDTH INTEGER 16
set_parameter_property TRIGGER_WIDTH DEFAULT_VALUE 16
set_parameter_property TRIGGER_WIDTH DISPLAY_NAME TRIGGER_WIDTH
set_parameter_property TRIGGER_WIDTH TYPE INTEGER
set_parameter_property TRIGGER_WIDTH UNITS None
set_parameter_property TRIGGER_WIDTH ALLOWED_RANGES -2147483648:2147483647
set_parameter_property TRIGGER_WIDTH HDL_PARAMETER true
add_parameter VECTOR_WIDTH INTEGER 14
set_parameter_property VECTOR_WIDTH DEFAULT_VALUE 14
set_parameter_property VECTOR_WIDTH DISPLAY_NAME VECTOR_WIDTH
set_parameter_property VECTOR_WIDTH TYPE INTEGER
set_parameter_property VECTOR_WIDTH UNITS None
set_parameter_property VECTOR_WIDTH ALLOWED_RANGES -2147483648:2147483647
set_parameter_property VECTOR_WIDTH HDL_PARAMETER true
add_parameter ENA_DDR BOOLEAN true
set_parameter_property ENA_DDR DEFAULT_VALUE true
set_parameter_property ENA_DDR DISPLAY_NAME ENA_DDR
set_parameter_property ENA_DDR TYPE BOOLEAN
set_parameter_property ENA_DDR UNITS None
set_parameter_property ENA_DDR HDL_PARAMETER true
add_parameter ENA_LVDS_PIO BOOLEAN true
set_parameter_property ENA_LVDS_PIO DEFAULT_VALUE true
set_parameter_property ENA_LVDS_PIO DISPLAY_NAME ENA_LVDS_PIO
set_parameter_property ENA_LVDS_PIO TYPE BOOLEAN
set_parameter_property ENA_LVDS_PIO UNITS None
set_parameter_property ENA_LVDS_PIO HDL_PARAMETER true
add_parameter ENA_LVDS_TX_DDR BOOLEAN true
set_parameter_property ENA_LVDS_TX_DDR DEFAULT_VALUE true
set_parameter_property ENA_LVDS_TX_DDR DISPLAY_NAME ENA_LVDS_TX_DDR
set_parameter_property ENA_LVDS_TX_DDR TYPE BOOLEAN
set_parameter_property ENA_LVDS_TX_DDR UNITS None
set_parameter_property ENA_LVDS_TX_DDR HDL_PARAMETER true
add_parameter ENA_LVDS_RX_DDR BOOLEAN true
set_parameter_property ENA_LVDS_RX_DDR DEFAULT_VALUE true
set_parameter_property ENA_LVDS_RX_DDR DISPLAY_NAME ENA_LVDS_RX_DDR
set_parameter_property ENA_LVDS_RX_DDR TYPE BOOLEAN
set_parameter_property ENA_LVDS_RX_DDR UNITS None
set_parameter_property ENA_LVDS_RX_DDR HDL_PARAMETER true
add_parameter ENA_LVDS_TX_SERDES BOOLEAN true
set_parameter_property ENA_LVDS_TX_SERDES DEFAULT_VALUE true
set_parameter_property ENA_LVDS_TX_SERDES DISPLAY_NAME ENA_LVDS_TX_SERDES
set_parameter_property ENA_LVDS_TX_SERDES TYPE BOOLEAN
set_parameter_property ENA_LVDS_TX_SERDES UNITS None
set_parameter_property ENA_LVDS_TX_SERDES HDL_PARAMETER true
add_parameter ENA_LVDS_RX_SERDES BOOLEAN true
set_parameter_property ENA_LVDS_RX_SERDES DEFAULT_VALUE true
set_parameter_property ENA_LVDS_RX_SERDES DISPLAY_NAME ENA_LVDS_RX_SERDES
set_parameter_property ENA_LVDS_RX_SERDES TYPE BOOLEAN
set_parameter_property ENA_LVDS_RX_SERDES UNITS None
set_parameter_property ENA_LVDS_RX_SERDES HDL_PARAMETER true
add_parameter ENA_TEST_FP_GEN BOOLEAN false
set_parameter_property ENA_TEST_FP_GEN DEFAULT_VALUE false
set_parameter_property ENA_TEST_FP_GEN DISPLAY_NAME ENA_TEST_FP_GEN
set_parameter_property ENA_TEST_FP_GEN TYPE BOOLEAN
set_parameter_property ENA_TEST_FP_GEN UNITS None
set_parameter_property ENA_TEST_FP_GEN HDL_PARAMETER true
add_parameter NUM_PIO INTEGER 8
set_parameter_property NUM_PIO DEFAULT_VALUE 8
set_parameter_property NUM_PIO DISPLAY_NAME NUM_PIO
set_parameter_property NUM_PIO TYPE INTEGER
set_parameter_property NUM_PIO UNITS None
set_parameter_property NUM_PIO ALLOWED_RANGES -2147483648:2147483647
set_parameter_property NUM_PIO HDL_PARAMETER true
add_parameter NUM_DDR INTEGER 8
set_parameter_property NUM_DDR DEFAULT_VALUE 8
set_parameter_property NUM_DDR DISPLAY_NAME NUM_DDR
set_parameter_property NUM_DDR TYPE INTEGER
set_parameter_property NUM_DDR UNITS None
set_parameter_property NUM_DDR ALLOWED_RANGES -2147483648:2147483647
set_parameter_property NUM_DDR HDL_PARAMETER true
add_parameter NUM_LVDS_TX_PIO INTEGER 8
set_parameter_property NUM_LVDS_TX_PIO DEFAULT_VALUE 8
set_parameter_property NUM_LVDS_TX_PIO DISPLAY_NAME NUM_LVDS_TX_PIO
set_parameter_property NUM_LVDS_TX_PIO TYPE INTEGER
set_parameter_property NUM_LVDS_TX_PIO UNITS None
set_parameter_property NUM_LVDS_TX_PIO ALLOWED_RANGES -2147483648:2147483647
set_parameter_property NUM_LVDS_TX_PIO HDL_PARAMETER true
add_parameter NUM_LVDS_RX_PIO INTEGER 8
set_parameter_property NUM_LVDS_RX_PIO DEFAULT_VALUE 8
set_parameter_property NUM_LVDS_RX_PIO DISPLAY_NAME NUM_LVDS_RX_PIO
set_parameter_property NUM_LVDS_RX_PIO TYPE INTEGER
set_parameter_property NUM_LVDS_RX_PIO UNITS None
set_parameter_property NUM_LVDS_RX_PIO ALLOWED_RANGES -2147483648:2147483647
set_parameter_property NUM_LVDS_RX_PIO HDL_PARAMETER true
add_parameter NUM_LVDS_DDR INTEGER 8
set_parameter_property NUM_LVDS_DDR DEFAULT_VALUE 8
set_parameter_property NUM_LVDS_DDR DISPLAY_NAME NUM_LVDS_DDR
set_parameter_property NUM_LVDS_DDR TYPE INTEGER
set_parameter_property NUM_LVDS_DDR UNITS None
set_parameter_property NUM_LVDS_DDR ALLOWED_RANGES -2147483648:2147483647
set_parameter_property NUM_LVDS_DDR HDL_PARAMETER true
add_parameter LVDS_TX_CHANS INTEGER 16
set_parameter_property LVDS_TX_CHANS DEFAULT_VALUE 16
set_parameter_property LVDS_TX_CHANS DISPLAY_NAME LVDS_TX_CHANS
set_parameter_property LVDS_TX_CHANS TYPE INTEGER
set_parameter_property LVDS_TX_CHANS UNITS None
set_parameter_property LVDS_TX_CHANS ALLOWED_RANGES -2147483648:2147483647
set_parameter_property LVDS_TX_CHANS HDL_PARAMETER true
add_parameter TX_SERDES_RATIO INTEGER 7
set_parameter_property TX_SERDES_RATIO DEFAULT_VALUE 7
set_parameter_property TX_SERDES_RATIO DISPLAY_NAME TX_SERDES_RATIO
set_parameter_property TX_SERDES_RATIO TYPE INTEGER
set_parameter_property TX_SERDES_RATIO UNITS None
set_parameter_property TX_SERDES_RATIO ALLOWED_RANGES -2147483648:2147483647
set_parameter_property TX_SERDES_RATIO HDL_PARAMETER true
add_parameter MAX_OP_WIDTH INTEGER 32
set_parameter_property MAX_OP_WIDTH DEFAULT_VALUE 32
set_parameter_property MAX_OP_WIDTH DISPLAY_NAME MAX_OP_WIDTH
set_parameter_property MAX_OP_WIDTH TYPE INTEGER
set_parameter_property MAX_OP_WIDTH UNITS None
set_parameter_property MAX_OP_WIDTH ALLOWED_RANGES -2147483648:2147483647
set_parameter_property MAX_OP_WIDTH HDL_PARAMETER true
add_parameter SHIFT_DEPTH INTEGER 128
set_parameter_property SHIFT_DEPTH DEFAULT_VALUE 128
set_parameter_property SHIFT_DEPTH DISPLAY_NAME SHIFT_DEPTH
set_parameter_property SHIFT_DEPTH TYPE INTEGER
set_parameter_property SHIFT_DEPTH UNITS None
set_parameter_property SHIFT_DEPTH ALLOWED_RANGES -2147483648:2147483647
set_parameter_property SHIFT_DEPTH HDL_PARAMETER true
add_parameter PCLK_CLK_RATIO INTEGER 8
set_parameter_property PCLK_CLK_RATIO DEFAULT_VALUE 8
set_parameter_property PCLK_CLK_RATIO DISPLAY_NAME PCLK_CLK_RATIO
set_parameter_property PCLK_CLK_RATIO TYPE INTEGER
set_parameter_property PCLK_CLK_RATIO UNITS None
set_parameter_property PCLK_CLK_RATIO ALLOWED_RANGES -2147483648:2147483647
set_parameter_property PCLK_CLK_RATIO HDL_PARAMETER true
add_parameter CLK_FREQ_MHZ INTEGER 60
set_parameter_property CLK_FREQ_MHZ DEFAULT_VALUE 60
set_parameter_property CLK_FREQ_MHZ DISPLAY_NAME CLK_FREQ_MHZ
set_parameter_property CLK_FREQ_MHZ TYPE INTEGER
set_parameter_property CLK_FREQ_MHZ UNITS None
set_parameter_property CLK_FREQ_MHZ ALLOWED_RANGES -2147483648:2147483647
set_parameter_property CLK_FREQ_MHZ HDL_PARAMETER true
add_parameter SLIM BOOLEAN false
set_parameter_property SLIM DEFAULT_VALUE false
set_parameter_property SLIM DISPLAY_NAME SLIM
set_parameter_property SLIM TYPE BOOLEAN
set_parameter_property SLIM UNITS None
set_parameter_property SLIM HDL_PARAMETER true
add_parameter DYNAMIC_COMBINE BOOLEAN true
set_parameter_property DYNAMIC_COMBINE DEFAULT_VALUE true
set_parameter_property DYNAMIC_COMBINE DISPLAY_NAME DYNAMIC_COMBINE
set_parameter_property DYNAMIC_COMBINE TYPE BOOLEAN
set_parameter_property DYNAMIC_COMBINE UNITS None
set_parameter_property DYNAMIC_COMBINE HDL_PARAMETER true
add_parameter SIM_TEST_MODE BOOLEAN false
set_parameter_property SIM_TEST_MODE DEFAULT_VALUE false
set_parameter_property SIM_TEST_MODE DISPLAY_NAME SIM_TEST_MODE
set_parameter_property SIM_TEST_MODE TYPE BOOLEAN
set_parameter_property SIM_TEST_MODE UNITS None
set_parameter_property SIM_TEST_MODE HDL_PARAMETER true
#
# display items
#
#
# connection point clock
#
add_interface clock clock end
set_interface_property clock clockRate 0
set_interface_property clock ENABLED true
set_interface_property clock EXPORT_OF ""
set_interface_property clock PORT_NAME_MAP ""
set_interface_property clock CMSIS_SVD_VARIABLES ""
set_interface_property clock SVD_ADDRESS_GROUP ""
add_interface_port clock clk clk Input 1
#
# connection point reset
#
add_interface reset reset end
set_interface_property reset associatedClock clock
set_interface_property reset synchronousEdges DEASSERT
set_interface_property reset ENABLED true
set_interface_property reset EXPORT_OF ""
set_interface_property reset PORT_NAME_MAP ""
set_interface_property reset CMSIS_SVD_VARIABLES ""
set_interface_property reset SVD_ADDRESS_GROUP ""
add_interface_port reset reset_n reset_n Input 1
#
# connection point csr
#
add_interface csr avalon end
set_interface_property csr addressUnits WORDS
set_interface_property csr associatedClock clock
set_interface_property csr associatedReset reset
set_interface_property csr bitsPerSymbol 8
set_interface_property csr burstOnBurstBoundariesOnly false
set_interface_property csr burstcountUnits WORDS
set_interface_property csr explicitAddressSpan 0
set_interface_property csr holdTime 0
set_interface_property csr linewrapBursts false
set_interface_property csr maximumPendingReadTransactions 0
set_interface_property csr maximumPendingWriteTransactions 0
set_interface_property csr readLatency 0
set_interface_property csr readWaitStates 4
set_interface_property csr readWaitTime 4
set_interface_property csr setupTime 0
set_interface_property csr timingUnits Cycles
set_interface_property csr writeWaitStates 1
set_interface_property csr writeWaitTime 1
set_interface_property csr ENABLED true
set_interface_property csr EXPORT_OF ""
set_interface_property csr PORT_NAME_MAP ""
set_interface_property csr CMSIS_SVD_VARIABLES ""
set_interface_property csr SVD_ADDRESS_GROUP ""
add_interface_port csr avs_csr_address address Input 16
add_interface_port csr avs_csr_write write Input 1
add_interface_port csr avs_csr_writedata writedata Input 32
add_interface_port csr avs_csr_read read Input 1
add_interface_port csr avs_csr_readdata readdata Output 32
set_interface_assignment csr embeddedsw.configuration.isFlash 0
set_interface_assignment csr embeddedsw.configuration.isMemoryDevice 0
set_interface_assignment csr embeddedsw.configuration.isNonVolatileStorage 0
set_interface_assignment csr embeddedsw.configuration.isPrintableDevice 0
#
# connection point seq
#
add_interface seq avalon end
set_interface_property seq addressUnits WORDS
set_interface_property seq associatedClock clock
set_interface_property seq associatedReset reset
set_interface_property seq bitsPerSymbol 8
set_interface_property seq burstOnBurstBoundariesOnly false
set_interface_property seq burstcountUnits WORDS
set_interface_property seq explicitAddressSpan 0
set_interface_property seq holdTime 0
set_interface_property seq linewrapBursts false
set_interface_property seq maximumPendingReadTransactions 0
set_interface_property seq maximumPendingWriteTransactions 0
set_interface_property seq readLatency 0
set_interface_property seq readWaitTime 1
set_interface_property seq setupTime 0
set_interface_property seq timingUnits Cycles
set_interface_property seq writeWaitTime 0
set_interface_property seq ENABLED true
set_interface_property seq EXPORT_OF ""
set_interface_property seq PORT_NAME_MAP ""
set_interface_property seq CMSIS_SVD_VARIABLES ""
set_interface_property seq SVD_ADDRESS_GROUP ""
add_interface_port seq avs_seq_address address Input 14
add_interface_port seq avs_seq_write write Input 1
add_interface_port seq avs_seq_writedata writedata Input 32
add_interface_port seq avs_seq_read read Input 1
add_interface_port seq avs_seq_readdata readdata Output 32
set_interface_assignment seq embeddedsw.configuration.isFlash 0
set_interface_assignment seq embeddedsw.configuration.isMemoryDevice 0
set_interface_assignment seq embeddedsw.configuration.isNonVolatileStorage 0
set_interface_assignment seq embeddedsw.configuration.isPrintableDevice 0
#
# connection point lvds_tx
#
add_interface lvds_tx conduit end
set_interface_property lvds_tx associatedClock clock
set_interface_property lvds_tx associatedReset ""
set_interface_property lvds_tx ENABLED true
set_interface_property lvds_tx EXPORT_OF ""
set_interface_property lvds_tx PORT_NAME_MAP ""
set_interface_property lvds_tx CMSIS_SVD_VARIABLES ""
set_interface_property lvds_tx SVD_ADDRESS_GROUP ""
add_interface_port lvds_tx lvds_tx_ser ser Output "(lvds_tx_chans) - (0) + 1"
add_interface_port lvds_tx lvds_tx_pio pio Output num_lvds_tx_pio
#
# connection point pio
#
add_interface pio conduit end
set_interface_property pio associatedClock clock
set_interface_property pio associatedReset ""
set_interface_property pio ENABLED true
set_interface_property pio EXPORT_OF ""
set_interface_property pio PORT_NAME_MAP ""
set_interface_property pio CMSIS_SVD_VARIABLES ""
set_interface_property pio SVD_ADDRESS_GROUP ""
add_interface_port pio pio_out pio_out Output num_pio
add_interface_port pio pio_out_en pio_out_en Output num_pio
add_interface_port pio pio_in pio_in Input num_pio
add_interface_port pio ddr_out ddr_out Output num_ddr
#
# connection point swim
#
add_interface swim conduit end
set_interface_property swim associatedClock clock
set_interface_property swim associatedReset ""
set_interface_property swim ENABLED true
set_interface_property swim EXPORT_OF ""
set_interface_property swim PORT_NAME_MAP ""
set_interface_property swim CMSIS_SVD_VARIABLES ""
set_interface_property swim SVD_ADDRESS_GROUP ""
add_interface_port swim STM8_SWIM_OUT tx Output 5
add_interface_port swim STM8_SWIM_IN rx Input 5
#
# connection point fpga_cfg
#
add_interface fpga_cfg conduit end
set_interface_property fpga_cfg associatedClock clock
set_interface_property fpga_cfg associatedReset reset
set_interface_property fpga_cfg ENABLED true
set_interface_property fpga_cfg EXPORT_OF ""
set_interface_property fpga_cfg PORT_NAME_MAP ""
set_interface_property fpga_cfg CMSIS_SVD_VARIABLES ""
set_interface_property fpga_cfg SVD_ADDRESS_GROUP ""
add_interface_port fpga_cfg cfg_dclk dclk Output 1
add_interface_port fpga_cfg cfg_data data Output 1
add_interface_port fpga_cfg cfg_config_done done Input 1
add_interface_port fpga_cfg cfg_nstatus nstatus Input 1
add_interface_port fpga_cfg cfg_nconfig nconfig Output 1
add_interface_port fpga_cfg cfg_init_done init_done Input 1
add_interface_port fpga_cfg cfg_oe oe Output 1
#
# connection point dac
#
add_interface dac conduit end
set_interface_property dac associatedClock clock
set_interface_property dac associatedReset ""
set_interface_property dac ENABLED true
set_interface_property dac EXPORT_OF ""
set_interface_property dac PORT_NAME_MAP ""
set_interface_property dac CMSIS_SVD_VARIABLES ""
set_interface_property dac SVD_ADDRESS_GROUP ""
add_interface_port dac dac_data_0 data_0 Output 15
add_interface_port dac dac_data_1 data_1 Output 15
#
# connection point irq
#
add_interface irq interrupt end
set_interface_property irq associatedAddressablePoint ""
set_interface_property irq associatedClock clock
set_interface_property irq associatedReset reset
set_interface_property irq bridgedReceiverOffset ""
set_interface_property irq bridgesToReceiver ""
set_interface_property irq ENABLED true
set_interface_property irq EXPORT_OF ""
set_interface_property irq PORT_NAME_MAP ""
set_interface_property irq CMSIS_SVD_VARIABLES ""
set_interface_property irq SVD_ADDRESS_GROUP ""
add_interface_port irq pwr_seq_irq irq Output 1
#
# connection point clk_x2
#
add_interface clk_x2 clock end
set_interface_property clk_x2 clockRate 0
set_interface_property clk_x2 ENABLED true
set_interface_property clk_x2 EXPORT_OF ""
set_interface_property clk_x2 PORT_NAME_MAP ""
set_interface_property clk_x2 CMSIS_SVD_VARIABLES ""
set_interface_property clk_x2 SVD_ADDRESS_GROUP ""
add_interface_port clk_x2 clk_x2 clk Input 1
#
# connection point clk_fpm_rx
#
add_interface clk_fpm_rx clock end
set_interface_property clk_fpm_rx clockRate 0
set_interface_property clk_fpm_rx ENABLED true
set_interface_property clk_fpm_rx EXPORT_OF ""
set_interface_property clk_fpm_rx PORT_NAME_MAP ""
set_interface_property clk_fpm_rx CMSIS_SVD_VARIABLES ""
set_interface_property clk_fpm_rx SVD_ADDRESS_GROUP ""
add_interface_port clk_fpm_rx clk_fpm_rx clk Input 1
#
# connection point clk_half
#
add_interface clk_half clock end
set_interface_property clk_half clockRate 0
set_interface_property clk_half ENABLED true
set_interface_property clk_half EXPORT_OF ""
set_interface_property clk_half PORT_NAME_MAP ""
set_interface_property clk_half CMSIS_SVD_VARIABLES ""
set_interface_property clk_half SVD_ADDRESS_GROUP ""
add_interface_port clk_half clk_half clk Input 1
#
# connection point debug
#
add_interface debug conduit end
set_interface_property debug associatedClock clock
set_interface_property debug associatedReset ""
set_interface_property debug ENABLED true
set_interface_property debug EXPORT_OF ""
set_interface_property debug PORT_NAME_MAP ""
set_interface_property debug CMSIS_SVD_VARIABLES ""
set_interface_property debug SVD_ADDRESS_GROUP ""
add_interface_port debug debug_out output Output 5
#
# connection point TIMING
#
add_interface TIMING conduit end
set_interface_property TIMING associatedClock clock
set_interface_property TIMING associatedReset ""
set_interface_property TIMING ENABLED true
set_interface_property TIMING EXPORT_OF ""
set_interface_property TIMING PORT_NAME_MAP ""
set_interface_property TIMING CMSIS_SVD_VARIABLES ""
set_interface_property TIMING SVD_ADDRESS_GROUP ""
add_interface_port TIMING TIMING_TX_N tx_n Input 1
add_interface_port TIMING TIMING_RX_P rx_p Input 1
add_interface_port TIMING TIMING_TX_P tx_p Output 1
add_interface_port TIMING TIMING_RX_N rx_n Output 1
#
# connection point rx
#
add_interface rx axi4 start
set_interface_property rx associatedClock clock
set_interface_property rx associatedReset reset
set_interface_property rx readIssuingCapability 1
set_interface_property rx writeIssuingCapability 1
set_interface_property rx combinedIssuingCapability 1
set_interface_property rx ENABLED true
set_interface_property rx EXPORT_OF ""
set_interface_property rx PORT_NAME_MAP ""
set_interface_property rx CMSIS_SVD_VARIABLES ""
set_interface_property rx SVD_ADDRESS_GROUP ""
add_interface_port rx axm_awaddr awaddr Output 32
add_interface_port rx axm_awprot awprot Output 3
add_interface_port rx axm_awvalid awvalid Output 1
add_interface_port rx axm_awready awready Input 1
add_interface_port rx axm_wdata wdata Output 32
add_interface_port rx axm_wlast wlast Output 1
add_interface_port rx axm_wvalid wvalid Output 1
add_interface_port rx axm_wready wready Input 1
add_interface_port rx axm_bvalid bvalid Input 1
add_interface_port rx axm_bready bready Output 1
add_interface_port rx axm_araddr araddr Output 32
add_interface_port rx axm_arlen arlen Output 8
add_interface_port rx axm_arsize arsize Output 3
add_interface_port rx axm_arburst arburst Output 2
add_interface_port rx axm_arcache arcache Output 4
add_interface_port rx axm_aruser aruser Output 1
add_interface_port rx axm_arprot arprot Output 3
add_interface_port rx axm_arvalid arvalid Output 1
add_interface_port rx axm_arready arready Input 1
add_interface_port rx axm_rdata rdata Input 32
add_interface_port rx axm_rvalid rvalid Input 1
add_interface_port rx axm_rready rready Output 1
#
# connection point pwm
#
add_interface pwm conduit end
set_interface_property pwm associatedClock clock
set_interface_property pwm associatedReset reset
set_interface_property pwm ENABLED true
set_interface_property pwm EXPORT_OF ""
set_interface_property pwm PORT_NAME_MAP ""
set_interface_property pwm CMSIS_SVD_VARIABLES ""
set_interface_property pwm SVD_ADDRESS_GROUP ""
add_interface_port pwm pwm_out_fan out_fan Output 1
add_interface_port pwm pwm_out_heat out_heat Output 4
add_interface_port pwm fan_sense fan_sense Input 1
#
# connection point hv_clk
#
add_interface hv_clk conduit end
set_interface_property hv_clk associatedClock clock
set_interface_property hv_clk associatedReset reset
set_interface_property hv_clk ENABLED true
set_interface_property hv_clk EXPORT_OF ""
set_interface_property hv_clk PORT_NAME_MAP ""
set_interface_property hv_clk CMSIS_SVD_VARIABLES ""
set_interface_property hv_clk SVD_ADDRESS_GROUP ""
add_interface_port hv_clk hv_clk_phase0 phase0 Output 1
add_interface_port hv_clk hv_clk_phase90 phase90 Output 1
add_interface_port hv_clk hv_clk_phase180 phase180 Output 1
add_interface_port hv_clk hv_clk_phase270 phase270 Output 1

View file

@ -0,0 +1,31 @@
This is a virtual processor (VProc) based test bench, created from the template in the fw_development_tools repository (git@hydra:GIS_Embedded_Logic/fw_development_tools.git). This is documented on confluence at:
https://confluence.gisapps.co.uk/display/EL/Testbench+Template+with+VProc
It is recommended to read this document if you are unfamiliar with this type of test bench. Additional documents for this specific repository, if available, would be located in <reporoot>/firmware/top/doc. The following is a list of setup requirements with links to the relevant sections of the document.
1. Link to generic_ip
If just checked out a new repostitory a link must be made to a EL-GENERIC-IP repostory (git@hydra:GIS_Embedded_Logic/EL-GENERIC-IP.git). See:
https://confluence.gisapps.co.uk/display/EL/Testbench+Template+with+VProc#TestbenchTemplatewithVProc-GenericIP
2. Cutomising makefile
The makefile has defaults for the location of things like the modelsim root directory, or the genric library. These may need customising to the local set up if different from the defaults. See:
https://confluence.gisapps.co.uk/display/EL/Testbench+Template+with+VProc#TestbenchTemplatewithVProc-Customisingthetestbench
3. Compilation dependencies
If not done already, MinGW (in repo git@hydra:GIS_Embedded_Logic/mingw.git) must be available to compile the test bench. See:
https://confluence.gisapps.co.uk/display/EL/Testbench+Template+with+VProc#TestbenchTemplatewithVProc-CompilationTools
4. Running tests
When the setup is correct, from this directory (in cmd shell or equivalent) various commands are available to build and run the simulation. See:
https://confluence.gisapps.co.uk/display/EL/Testbench+Template+with+VProc#TestbenchTemplatewithVProc-Commands

Binary file not shown.

View file

@ -0,0 +1,8 @@
@set FWTOOLSDIR=e:\git\fw_development_tools\logic_memory_mapper
@REM generate the testbench registers
@py -3 %FWTOOLSDIR%\gen_hdl.py -j .\doc\test.json -o .\ -s _auto
@py -3 %FWTOOLSDIR%\gen_htm.py -j .\doc\test.json -b csr -B
@py -3 %FWTOOLSDIR%\gen_elhal.py -j .\doc\test.json -b csr -o .\src\hal
@REM Add project specific build here. Normally just point to top of the repository for hierarchical scan

View file

@ -0,0 +1,10 @@
# Change this to proper relative path once in test bench location
# DRM changed line below to make it compatible with wsl and my home set-up
export FWTOOLSDIR=/mnt/c/Projects/firmware_tools/logic_memory_mapper
# Generate the testbench registers
python3 $FWTOOLSDIR/gen_hdl.py -j ./doc/test.json -o ./ -s _auto
python3 $FWTOOLSDIR/gen_htm.py -j ./doc/test.json -b csr -B
python3 $FWTOOLSDIR/gen_elhal.py -j ./doc/test.json -b csr -o ./src/hal
# Add project specific build here. Normally just point to top of the repository for hierarchical scan

View file

@ -0,0 +1,6 @@
# Create clean libraries
foreach lib [list work tb_pkg] {
file delete -force -- $lib
vlib $lib
}

View file

@ -0,0 +1,6 @@
# Compile the code into the appropriate libraries
# Uncomment vlog command if files_vlog.tcl isn't empty
#vlog -quiet -f files_vlog.tcl -work work
vcom -quiet -2008 -f files.tcl -work work

View file

@ -0,0 +1,251 @@
<!DOCTYPE html>
<!-- ********************************************* -->
<!-- * AUTO-GENERATED BY gen_htm.py. DO NOT EDIT * -->
<!-- ********************************************* -->
<html lang="en-GB">
<head>
<title>Datasheet for TEST GIS soft IP component</title>
<style>
h1, h2, h3, h4 {
font-family: Helvetica, Arial, sans-serif;
}
p {
font-family: Helvetica, Arial, sans-serif;
font-size: 10pt;
text-justify: auto;
}
table#main {
font-family: Helvetica, Arial, sans-serif;
font-size: 11px;
border-collapse: collapse;
width: 850px;
border: 3px solid #009ab0;
}
table#main td {
border: 1px solid #80c0c0;
text-align: left;
padding: 5px;
font-family: "Lucida Console", Monaco, monospace;
}
table#main th {
border: 1px solid #dddddd;
text-align: left;
background-color: #009ab0;
color: #ffffff;
padding: 5px;
}
table#key {
font-family: Helvetica, Arial, sans-serif;
font-size: 8pt;
border-collapse: collapse;
width: 500px;
border: 0px;
}
table#key td, th {
text-align: left;
padding: 5px;
vertical-align: top;}
</style>
</head>
<body>
<img src="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAALgAAABACAYAAACp8r2zAAASHklEQVR4nO2df7QVxX3AP3mlHELfoZRaSim1aACRIlF+GKJRqZJUouAYIf5AK5U4rSCaRKmYFD3GoImC
xhCVDGoIGmNFdEQLhBBQIIIaX1ARkCJQQEqppRz6jofSd177x3eGu3fv3ru79+1990n3c849+97emdm593535jvf73e+Czk5OTk5OTk5HY5P1bsDORUw9lvANcBMtHqu
3t35JNJQ7w7kVOQiYCBwWb078kklF/COzf7QMScluYDnHNfkAp5zXJMLeM5xTS7gOcc1nerdgU8MxjagVWu9u1E1xnYDRiG/+Sa02hZRZhBwGK32xrTVBxgOtALr0Opg
6P0GoB/QmcIgugutDldocyBwCK32h843AIOAg2i1r2K/IshGwI3tgXx5/YDPAb2BbhQ+3FHgILANeBdoQqvX2njNToACuiBfdBQNwH60Wpmy7X7A+cDZiJmuO9AVY1uB
I8BhYBewHtiIVquq+ATth7Hzga+FzjUBk9Fqo/u/AXgPWAl8sUw7PYCfAheHzi9wbfnfoQewhbCGYOwzwMSSgcLYvq78IeAPQlftisjMM8CVFT5lJG0TcGMvBm4GRgKN
CWqMCtTdBSwFHkarzVVcvSuwKEG5HcBnErVo7LnATGB0gtLDgfGu3nbgOWAOWn2U6FrthbFrgS8ArwD3Ah8DY4G/B36LsWPQanmgRrRMGNsZeB84AXgamI8I8O3AJGAw
MMKVbnCvlcBcd+5SV64zpXb9q9yxO8aORKsNgff8TVKVrFYn4MZeDUwHhlRVX+gLTAGmYOzzwCy0akpRvxX5sbrGlIu3IRvbCPyYwhedln7ADOBGjL0bre6rsp1sMfZu
RLino9XswDvrMPZJZGQcAwQF/EiZ1hYhwn0RWi0NnF+FsVOAhzH2YbSaCrS491aj1RL39xKM/RLwlYi2pwN7kZl/JuLg8vjRvly/KpJukWnsUIx9FXiStgl3mK8Ab2Hs
XDdSJCWJTly5jOh+W6heuIM0At/H2NedmlM/ROX4B2B3SLgFrTah1afQ6mZ3prwsiG4+DngqJNy+rUeAjchg1YCoGgB/FGijL3KDFOv3xl6IqIATgNnAl536mQnJGzL2
OuDxrC5chhuRDzi2SrUlHcb2Bt4ifhZIy5nAFvc5lseWrg1+AHr02BljuwOzKAjzHuDTwM/QaivGlmvrfHes9PvPde8PRqt3MPYo8HWMvSlwvUPAn4fq3QaAVhsw9iNE
dRqP6NxtJtkIbuyt1F64PScjo/nIdrjWWrIXbk8nYBnGXuVGtfbGXzM4tXdH1MK/c69ZyCg/PGFblWZDr5YEP+s+YB2wBmhy159x7F2ZrUcBzwKg1XbEGHF7TH8SE//F
i3Dfn9UFE9IFWI+xZ9bsCsY+iNxMteZR5PO0N++44w2Bc7uBP3Wv3wWMOx9n0VrjjhMrlLneHTe5Y2fgCbQ6z72GAY8BszDWzy5eHz8BY+/F2FnITTTEmSKhjb6aypWN
vYr2F+4gv66JLmtsT+DrmbdbyhrgDLT6uB2uVYxWLcCPgAEY+zV3rhWt9rlXC6CBrWi1I1CzOaKtjchNoDG2dLQ3djyymH0OrVqcKgSlI/56d+zpjv7mOx8Z2b+F6OkA
fxuqW96GXoHyOrjcQT+rptEM6QS8iow4WXJ1irLNyDT7huvPWYiOHafa/DCwgKsPWk3D2FHAfIwdBvwE+TxnIWY+8CY7UaNagX6uDsjnPYBW77hyHwJvYuydwMvu/YnA
TchidoKr5w0FQ5yq6Z01/pqrnHpyLvA8Iuid3PU7ATuBWxGLir/hBpXpV0UqLTJfiKtchg3ACuAD5K7rhBj+T0Hu1NNTttcbY38FfDFDT+IlCcu9jDgwDhSdlRlgKnBH
RJ2jiDOjo2xQGAb8nILe7TkAXBZazLciv8/qwLltwClotR9jT3Ft3eVenqVEO2GUe3l2A5ejVSvGznHnvh3x/c4GZmDsULRqcovfUQT9KL5fMZQz6n+V+IVHmAXAg7F3
lejVtwBfTdhuM7JAyZKBCcrsQquxke/ID3Inxi5DhMHr2E3AhNCUX1+0OgpchrEnI2pEI7AZrV4JlWvF2POQmcmPwK3AR4Ey24ERGDsUGIosLF+LcPsfBP7StePb2hfy
c7wAvIBWWyN6fSfwSwrmxvNCbRX3qwLRW9aM3Yk4YpLQDFyLVs8nLO+vMQmZMivxBHB7yR0u9RuBfyXeg7oOrc4J1Ovh6sXZ2x9Aq1tiyuCcF78AlqPVmNjyaTB2MbIQ
+wFafSPTtv+fULrIFHd134T1DwKfTS3cAFotQO7MKJYDI9CqVD1oO43ECzcktbBotQI4J3PhzsmEKCvKtBT1z27TdKzVGmRTrWcDMBatxqDVb6putzKHSeb2VS4kIR6t
1rWpRzk1I0rAv5Sw7p1l9Kd0aPUUspi7B60+j1Yvt7nNytc7RHKT05MufGBwLbuUUzuKF5minnRLUO8gWn0ns16UW8zVju0UbLFx3IgEUb0CvAQszeTGbg+M7QU0HIuj
FtNvS5mY695ILPhhjO2K2KO9vTzYXt9QtJ9/z9c5gFZH3FqnK8W28AZEdj52lqjOlNrKJZZFq1J7fBWER/CkJryHsrh4HanGBDoKmIPEmLyFsQ+5AaEj8zoS4uoFcCew
xwWYBemNxKX4RfUk4F8IBtQZOw5ZnE8tc62rXJ1R7v8fuzY/DLz2IKECuLb2BM4Hy2Tmqg+bCWPtio74RaWxv0QWqy0xJZPSGZiPVt/LoK0FtM1D681kN2HsZuBh4NkO
FwsusR9BK5P/vV+k+Lf2A12XyKOxA1ydg8C1Za7l6/gF/AB3nBe6jh/9vw38MaIxXIdEGT6PjOi/KP+R0hEW8CQhsM2IkT2Oc0lmrUjDqZm0otVHGDsTuDuD1gYhAv59
jH0EuNfp+R0B72jztCCOqAEYe0dAzQzHXB91R+/TeNsdT6ngbDsaOnZDVJ4bIksHByqJVF1SC89vWEXpE1mqmCbnPIgj9f65BByML5IQrb4LlI0PrYJGJNTznzE2Kqi/
I9AJGVHnAXcF4nzCA52Xi84Y+5J7/9SUM1Qyr7OELIN4uzMnLOBJQkezE7J6o9Wl+FDN7DgBWIyx38y43axoCIyqy9wxPOP4AezXyP7L/VUsrHcAjW7zx5vu9S7GXlFd
t6sjLOAdfdd49nHVWl2ObJlKMiulYQ7GtkfEYlq8bnw9Elg1PkKl8tGPA4EfAn0wNsn+1yBHkd/rTCTsYziyb7NXVb2ukrDAJLEPt2sH2wXZ0tUf+TGzXCg+6LZ7dSRk
0a/VY0iE5CKMHY0MbgXVRLjN6cVLgPEx/gBvTPDqTj+g2W2LC75+kOFniSUs4LsT1DkdY+sRwA/Zj7IFtNrtfsyTEEvBioxafjS+SN24wB2XIbLwX+5///s+5Y6XB8qV
Izw4diY7C1rVhBcXG4lPmdAFmbo2xpSrxVawD2rQZjHiYFgILHSLsNFIzMxoCsH4aTgXY/sQl0ynNnSi1JJVGNS0asbYqYgVCAoDiC/TC3H2HMHYacBcjJ2EVgswVgGL
EfVuAeCDwXzE4GFEtbkwdP2taLUroj812dYXbvT9hPWSJGBJeve2pigbG+CeKVptR6t5aHUlsll2DBLhmNbLNj7zviWjJ6WDWPei/2RHvE/t4L3YfnDqFCj3I2SG/wnG
nghsRixlc4D/QDZR3Ech+1Qzfl9q8StsNvQy2J0aEP7wSbNNTcHvhi7POSS3g79OshCBJPb32iDbzpYDyzH2NsTbltRSMqxm/arMeRR+4yOISlK6xtDqEow9HwlhAFFN
3kCEOMgZiH8DFwP+Z27vwBnASxRnK7uB6BssbI3Z7/qVddQoEBUPbuyHiOs2ju+hVdtdqjKFVdLtPE1u46qvV108eOW+9EwVnmvs44gXLg7rTJLpyOPB20yU3pN0q9UM
jP1Cm64u+/L+MWHpF9t0rThkW9wHpEs8NDe+CJC9RzcnIVECniaQ6tXARtBqWE0y1QRkIZM9xp6Mse8i+0UbEedGUpJGJFaVdiyn7ZQKuGxgWFNatGz91am9dsaeiLFv
IguTJKxCqyQmzHTIdrN3EQeEZzjGrk5oCo1bh3iqSnmQ03bK7aqfivzwSZmDsdci5qaXKZfHWcI0JyIxG2mm7ekpyibD2Dso3hkeZBQSFjs9cne8hJ7OoZDSLI7Xq+li
Zkhsdk9gx7E4IskX3hoZdy3x4ScUrUekjV6ujSOBciADXWlct48ll3LhMsH3xWZeKWuC5CtsLSoj9U5GYtAjQ0iiBVyrTUjO50llL1jKECQGuMWFkO6lEHDV23UkyW72
MJZ0WWcrI1/2IqKznAbpi3j5tiF5Ud5DfqDTkESUaWziS+KL1Ahjfw5cEfh/ITLzNAA7Mda6cAX//kAkQc/TwFQnWIsIpn8w9gkkdrwZ+J/A1fYRNFAYewmSXfZFZEd/
sSnQ2AluAFmEzJwXRMa8GHs/kstmMpKiwp+7NVBmBfCNUBqMinlRrge+THI9M9jmELLJPttM5XRh6TD2LOQmTLMFbQCF+I1q+E3ZGa3WGPsicjMa4LfId/nXwHq0moex
zwJXY+zjbvM0iPOmOzJDgWwOuRix/7+JZIG9DliGVs9h7API2qUPIi+bkQEBCmbH0YiDcCGFmbsBCcgCuSl6I9a0k0Kf4SwKgtzNnZvizq10/fsLxHQ9k5CPpryASwqu
sxHnT72e5fNXZJv27F7SCXcWJNXTs0Wm73HIEyh8GrR5TmBkRtTqGhfauwz4HWeyHQRMQ6sdbra7GFiJVpMDbQzF28h9ag1J1/afwP0uY0KQLkj+lHKbJbya1Bdj56LV
NNdmV4oX/V4WHkJUmsKTKOQpFiW54CsLriR6SWZDzp7JtPUxJ6VcTiE5ZHuwgvo93sTrqoOLzLlavXZMhxbGAg0YOxdRFTY7ryVO320BRhZtz9OqKdQGFGa5csF4lSJV
+yChH7OR/a8+6epad/QqlF/4Sxo9yYno+7SxZK8pSUZmEbILYjqYNbeg1ROZtypfwAji42iy4DAyndcHWcBdhMzSazF2C5JsKVxuFaJ+3IioGuH8Lpe4869i7Af4RJ7p
2AsMxNj7MXaOewUjLTsDjWg1HfG0/hPG3oVsCxxBYYuk1ziuceUWYex/Y+wMtwguIZnqIV/CZ6n96NcCXINWD9TsClodQaszSO7QqoZDwDAqPVWsPZCnMZyEhAH3ReJI
3keethDEW6meLjHHShufAR5ARuf5buNCmh04+5FF+a1IeMM3key+fp3WSmE32edc2TuAZ1x+nOGBct6U3R/Z17kbUT3/zalfRSTXreWRF6e5RmvhuFiK7Pl7KrZkFkgm
1L8h++fANwGnOfWu/mi1C61uRqtPI2HAAyjNGux1211l2tiBVreg1e8hi7jBpMtMMAQJlPv90Cs4yBw9di1RVQ64IDeICsfQ6hBa3YNW/YHPu7O/ChdLv3jU6h5kVHiM
bOJ9tyEZRy8iXZasBpI92a18GVkM9UfyaGehgs1Gq2F1Co0txdghLmZH0GohIszhka4xdAy3UXB6afUMEhiVJmVGZ3zOleJXtPyIqtI/cKb46RHG9nURjb78BuSRJyXO
ueoe9iO67PVOTxqH6Gmnk9ykuBsxJS2mmryGQiuiClRy9TcQ50UUR8c0Z1e9Annc3ekkfyrDNkRH/GmkDbdeSF7u9cAOjB2DzFQKCYUtZ5cPP9dyKPIMo00YOwGxc3vT
8dNl6kYNmkeAnhG7m3a777+BsCxGq3cHnWVnp+vfOcjMMBCxk5dESrbtaVYyUj0CPOLMUiMRh04v4A8RXUqSlcO/I1/QVrR6o03XlWs3Y+ypFBKnR9FAUnVKdM/7gPuQ
rEsjgROBP3FHfyMdQjZe7AXeoXY5FNvKLmTxeB3Fcf6bEdUsiBfKsF69O9DGlsD5jRQeWeLx9u3wg1xBZo0BiLMsyETkRulDZW3CDzY9kTTPPuXH2kCZo0jK5iKye5S3
uIDXkDyOJYtrZq0/+3YPUE/vYxbIdzMZSTQ/Dnmk39tOTQlzCNHPi40IkiZisjMhXujaeK+MhWuTayPqhr8SGfSCs2IDBYfQpVQO3Whyba9z/fqu86YqZAG8B1hYzl2f
01ExdjHG/i/ywKycKqiXhzInp13IBTznuCYX8JzjmlzAOzY9QseclOQC3rHZikTavR1XMCcnJycnJycnJycnpyPwf6qZnReB1P5+AAAAAElFTkSuQmCC"
alt="gis_logo.png">
<h1>Datasheet for the TEST GIS Soft IP Embedded Logic</h1>
<h2>Register Definitions</h2>
<table id="main" style="margin-left:20px">
<tr>
<th>test</th>
<th colspan="7" style="font-family: Helvetica, Arial, sans-serif;"font-family: Helvetica, Arial, sans-serif;>This block the top leve test bech</th>
</tr>
<tr>
<th>Register Name</th>
<th>Byte Addr Offset</th>
<th>Field</th>
<th>Bits</th>
<th>Type</th>
<th>subtype</th>
<th>Reset</th>
<th style="font-family: Helvetica, Arial, sans-serif;">Description</th>
</tr>
<tr>
<td valign="top" rowspan=5 style="border-bottom: 2px solid #80c0c0">CSR_TEST_CONTROL</td>
<td valign="top" rowspan=5 style="border-bottom: 2px solid #80c0c0">0x0</td>
<td> </td>
<td>4</td>
<td> </td>
<td> </td>
<td> </td>
<td style="font-family: Helvetica, Arial, sans-serif;">Testbench simulation control</td>
</tr>
<tr>
<td>ERROR</td>
<td>0</td>
<td>w</td>
<td></td>
<td>0</td>
<td style="font-family: Helvetica, Arial, sans-serif;">Set error state</td>
</tr>
<tr>
<td>DO_STOP</td>
<td>1</td>
<td>w</td>
<td></td>
<td>0</td>
<td style="font-family: Helvetica, Arial, sans-serif;">Request simulation to stop</td>
</tr>
<tr>
<td>DO_FINISH</td>
<td>2</td>
<td>w</td>
<td></td>
<td>0</td>
<td style="font-family: Helvetica, Arial, sans-serif;">Request simulation to finish</td>
</tr>
<tr>
<td style="border-bottom: 2px solid #80c0c0">PARTIAL_TEST</td>
<td style="border-bottom: 2px solid #80c0c0">3</td>
<td style="border-bottom: 2px solid #80c0c0">w</td>
<td style="border-bottom: 2px solid #80c0c0"></td>
<td style="border-bottom: 2px solid #80c0c0">0</td>
<td style="font-family: Helvetica, Arial, sans-serif;border-bottom: 2px solid #80c0c0">Flag that not all tests were run</td>
</tr>
<tr>
<td style="border-bottom: 2px solid #80c0c0">CSR_TEST_TIME_COUNT</td>
<td style="border-bottom: 2px solid #80c0c0">0x4</td>
<td style="border-bottom: 2px solid #80c0c0"> </td>
<td style="border-bottom: 2px solid #80c0c0">32</td>
<td style="border-bottom: 2px solid #80c0c0">r</td>
<td style="border-bottom: 2px solid #80c0c0"> </td>
<td style="border-bottom: 2px solid #80c0c0">0</td>
<td style="font-family: Helvetica, Arial, sans-serif;border-bottom: 2px solid #80c0c0">System clock timing counter</td>
</tr>
<tr>
<td style="border-bottom: 2px solid #80c0c0">CSR_TEST_TIMEOUT</td>
<td style="border-bottom: 2px solid #80c0c0">0x8</td>
<td style="border-bottom: 2px solid #80c0c0"> </td>
<td style="border-bottom: 2px solid #80c0c0">31</td>
<td style="border-bottom: 2px solid #80c0c0">w</td>
<td style="border-bottom: 2px solid #80c0c0"> </td>
<td style="border-bottom: 2px solid #80c0c0">10000000</td>
<td style="font-family: Helvetica, Arial, sans-serif;border-bottom: 2px solid #80c0c0">Simulation timeout (in clock cycles)</td>
</tr>
<tr>
<td>CSR_TEST_CONFIG_CLK_FREQ</td>
<td>0xc</td>
<td> </td>
<td>9</td>
<td>r</td>
<td> </td>
<td>0</td>
<td style="font-family: Helvetica, Arial, sans-serif;">Clock frequency configuration values</td>
</tr>
</table>
<p style="margin-left:20px"><i>Register/field type key:</i></p>
<table id="key" style="margin-left:30px">
<tr>
<th>Type</th><th>Description</th>
</tr>
<tr>
<td>c</td><td>Constant, with value defined by "reset" attribute
</tr>
<tr>
<td>rsv</td><td>Same as constant, except no reset value and always 0. Can be mixed with write types.</td>
</tr>
<tr>
<td>w</td><td>Write register (and read—no write only type). Register defined in register block and reset to "reset" attribute value. Split into fields (if applicable) for signalling and output, where attribute associated with fields, not register.</td>
</tr>
<tr>
<td>wp</td><td>Write with pulse. Register is not declared in block, but write bus split into fields as output port signals, and a pulse generated on write to register address. Register reads back 0. The "reset" attribute is for documentation only, as set externally.</td>
</tr>
<tr>
<td>w0</td><td>Same as w, but auto-clears to 0 (and thus always reads as 0). At output port, signal will go high for one cycle when bit is written with a 1 (no effect if written to a 0). No "reset" attribute, as must always be 0.</td>
</tr>
<tr>
<td>r</td><td>Read only value. Input ports generated for each field (where applicable), and concatenated on returned read data bus.</td>
</tr>
<tr>
<td>rp</td><td>Similar to r, but a pulse generated on a read access to the register address to allow peripheral logic to update value. The "reset" attribute is for documentation only, as set externally.</td>
</tr>
<tr>
<td>rwp</td><td>Similar to wp, but also generates a (separate) pulse on a read access to the register</td>
</tr>
<tr>
<td>bitdef</td><td>Defines the bits used in the read, set, clear registers</td>
</tr>
<tr>
<td>&nbsp;</td><td>&nbsp;</td>
</tr>
<tr>
<th>Subype</th><th>Description</th>
</tr>
<tr>
<td>unsigned</td><td>Register/field is specified as an unsigned value.
</td></tr>
<tr>
<td>signed</td><td>Register/field is specified as a signed value.
</td></tr>
<tr>
<td><i>&lt;blank&gt;</i?</td><td>Register/field sign status is not explicitly defined and defaults to unsigned.
</td></tr>
</table>
<p>&nbsp;</p><hr>
<p style="font-style:italic">Copyright &copy; 2026 Global Inkjet Systems. Generated by gen_htm.py &mdash;2026-4-16 21:05</p>
</body>
</html>

View file

@ -0,0 +1,79 @@
[{
"ip_name" : "test",
"bus" : "csr",
"addr_hi_bit" : "28",
"addr_lo_bit" : "24",
"description" : "This block the top leve test bech",
"sub_blocks" : {
"uut" : {
"instance" : "",
"process" : "disabled",
"offset" : "0x00000000"
},
"memory" : {
"instance" : "",
"process" : "disabled",
"offset" : "0x08000000"
},
"local" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x18000000"
}
},
"registers" : {
"control" : {
"address" : "0",
"width" : "4",
"description" : "Testbench simulation control",
"fields": {
"error" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Set error state"
},
"do_stop" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Request simulation to stop"
},
"do_finish" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Request simulation to finish"
},
"partial_test" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Flag that not all tests were run"
}
}
},
"time_count" : {
"address" : "1",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "System clock timing counter"
},
"timeout" : {
"address" : "2",
"width" : "31",
"type" : "w",
"reset" : "10000000",
"description" : "Simulation timeout (in clock cycles)"
},
"config_clk_freq" : {
"address" : "3",
"width" : "9",
"type" : "r",
"reset" : "0",
"description" : "Clock frequency configuration values"
}
}
}]

View file

@ -0,0 +1,24 @@
# ------------------------------------------------------
# If you update this file, also update ../../sim/comp.do
# ------------------------------------------------------
# #########################################
# Add project specific files here
# #########################################
# #########################################
# Testbench files
./test_pkg_auto.vhd
./test_csr_decode_auto.vhd
./test_csr_regs_auto.vhd
# Suggest making these absolute paths relative once in the test bench folder
/mnt/c/Projects/firmware_tools/verification/vproc/vproc_pkg.vhd
/mnt/c/Projects/firmware_tools/verification/vproc/vproc.vhd
/mnt/c/Projects/firmware_tools/verification/vproc/avsvproc.vhd
/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model_pkg.vhd
/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model.vhd
./tb_pkg.vhd
./tb_ctrl.vhd
./tb.vhd

View file

@ -0,0 +1,7 @@
# #########################################
# Add project specific files here
# #########################################
# #########################################

Binary file not shown.

View file

@ -0,0 +1,137 @@
###################################################################
# Makefile for template testcode in Modelsim
#
# Copyright (c) 2018 - 2020 Global Inkjet Systems
#
###################################################################
# User files to build, passed in to vproc makefile build
USERCODE = VUserMain0.cpp utils.cpp
# Get the OS type
OSTYPE:=$(shell uname)
# Set the OS specific variable between Linux and Windows (MinGW)
# Change OSTYPE test to makeit the same a WSL. I have also to chage location of modelsim
# The reason why there are two modelsim paths is to allow to run the gui when the other is busy running simulations.
$(info OSTYPE=$(OSTYPE))
ifeq (${OSTYPE}, Linux)
MODELSIMDIR = /opt/intelFPGA_lite/20.1/modelsim_ae
MODELSIMDIRAUX = /opt/intelFPGA_lite/20.1/modelsim_ase
MAKE_EXE = make
VSIMEXE = ${MODELSIMDIRAUX}/linuxaloem/vsim
VSIMEXEAUX = ${MODELSIMDIRAUX}/linuxaloem/vsim
VSIMARGS = -cpppath /usr/bin
AUTOSCRIPT = ./autogen.sh
CMDSHELL = bash
else
MODELSIMDIR = c:\altera\ver\modelsim_ae
MODELSIMDIRAUX = c:\altera\ver\modelsim_ase
MAKE_EXE = mingw32-make
VSIMEXE = ${MODELSIMDIR}\\win32aloem\\vsim
VSIMEXEAUX = ${MODELSIMDIRAUX}\\win32aloem\\vsim
VSIMARGS =
AUTOSCRIPT = autogen.bat
CMDSHELL = cmd /c
endif
FWDEVTOOLS = /mnt/c/Projects/firmware_tools/
VPROCDIR = ${FWDEVTOOLS}/verification/vproc
# Define where the HAL directory is for the auto-generated code
HALDIR = src/hal
# Pick single target files for two auto-generations---UUT and test.
# The core.h file is always presentfor the UUT, and the test package
# for the test bench
TBAUTOFILE = test_pkg_auto.vhd
LIBDOCDIR = ${FWDEVTOOLS}/verification/lib/hdl/doc
# Add JSON files build is dependent on
JSONFILES = doc/*.json \
${LIBDOCDIR}/*.json
# If no external code directory (e.g. a HAL) set this to local source directory, else set to code directory
EXTINCLDIR = ${CURDIR}/src
HALCOPTS = -DVPROC_VHDL
#------------------------------------------------------
# BUILD RULES
#------------------------------------------------------
# Build is dependent on generating the auto-gen file and
# processing makefile in vproc
all: ${TBAUTOFILE} vproc
# Make test bench auto-gen code dependent on all the JSON files to
# call the batch file if any have changed
${TBAUTOFILE}: ${JSONFILES}
@${CMDSHELL} ${AUTOSCRIPT}
# Call the vproc make file for it to determine if anything
# needs building.
.PHONY : vproc
vproc:
@${MAKE_EXE} -C ${VPROCDIR} \
TESTDIR=${CURDIR} \
USER_C="${USERCODE}" \
MODELSIMDIR="${MODELSIMDIRAUX}" \
EXTINCLDIR="${EXTINCLDIR}" \
HALCOPTS="${HALCOPTS}"
#------------------------------------------------------
# EXECUTION RULES
#------------------------------------------------------
run: all
@rm -rf sim.log
@${VSIMEXE} -c -do sim.do ${VSIMARGS}
rungui: all
@${VSIMEXE} -gui -do simg.do ${VSIMARGS}
runlog: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXE} -c -do simlog.do ${VSIMARGS}
runfree: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXEAUX} -c -do simlog.do ${VSIMARGS}
runwaves:
@${VSIMEXEAUX} -view vsim.wlf -do wave.do
compile:
@${VSIMEXE} -c -do compile.do -do quit
autobuild:
@${AUTOSCRIPT}
gui: rungui
sim: run
log: runlog
free: runfree
waves: runwaves
#------------------------------------------------------
# CLEANING RULES
#------------------------------------------------------
clean:
@${MAKE_EXE} -C ${VPROCDIR} USER_C="${USERCODE}" TESTDIR="${CURDIR}" clean
@rm -rf "wlf*"
@rm -rf *.wlf
@rm -rf batch.do
@rm -rf *_auto.vhd
@rm -rf sim.log
@rm -rf src/hal/*.h
@vsim -c -do cleanvlib.do -do quit
@rm -rf work
@rm -rf tb_pkg
@rm -rf transcript

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,20 @@
# Create clean libraries
foreach lib [list work] {
file delete -force -- $lib
vlib $lib
}
# Compile the code into the appropriate libraries
do compile.do
# Get any command line argumens added to the .do file call
set vsimargs [lrange $argv 3 end]
# Run the tests.
vsim -quiet -pli VProc.so +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 1ns tb -l sim.log
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
run -all
#Exit the simulations
quit

View file

@ -0,0 +1,21 @@
# vsim -quiet -pli "VProc.so" "+nowarnTFMPC" -L altera_mf_ver -L altera_mf -t 1ns tb -l sim.log
# Start time: 21:05:49 on Apr 16,2026
# 1
# 1
#
# *****************************
# * Global Inkjet Systems *
# * Company run by idiots *
# * Virtual Processor (VProc) *
# * Copyright (c) 2020 *
# *****************************
#
# Entered VUserMain0()
#
#
# VUserMain0() finishing with status 0
#
# ** Note: SUCCESS
# Time: 2300 ns Iteration: 3 Instance: /tb/tb_ctrl_inst
# End time: 21:05:50 on Apr 16,2026, Elapsed time: 0:00:01
# Errors: 0, Warnings: 0

View file

@ -0,0 +1,20 @@
# Create clean libraries
foreach lib [list work] {
file delete -force -- $lib
vlib $lib
}
# Compile the code into the appropriate libraries
do compile.do
# Run the tests
# Get any command line argumens added to the .do file call
set vsimargs [lrange $argv 3 end]
# Run the tests
vsim -quiet -pli VProc.so -gGUI_RUN=true +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 100ps -gui tb
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
do wave.do
run -all

View file

@ -0,0 +1,22 @@
# Create clean libraries
do cleanvlib.do
# Compile the code into the appropriate libraries
do compile.do
# Get any command line argumens added to the .do file call
set vsimargs [lrange $argv 3 end]
# Run the tests.
vsim -quiet -pli VProc.so +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 1ns tb -l sim.log\
[lindex $vsimargs 0] [lindex $vsimargs 1] [lindex $vsimargs 2] \
[lindex $vsimargs 3] [lindex $vsimargs 4] [lindex $vsimargs 5] \
[lindex $vsimargs 6] [lindex $vsimargs 7] [lindex $vsimargs 8]
do batch.do
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
run -all
#Exit the simulations
quit

View file

@ -0,0 +1,225 @@
/**************************************************************/
/* VUserMain.cpp Date: 2018/08/9 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
// --------------------------------------------------
// INCLUDES
// --------------------------------------------------
#include <string.h>
#include "VUserMain0.h"
#include "utils.h"
#include "tb.h"
#include "hal/CTestAuto.h"
// Access to memory model's direct API (C linkage)
extern "C" {
#include "mem_model.h"
}
//######################################################
//# Add test code includes here
//######################################################
//#define DEBUG
// --------------------------------------------------
// DEFINES
// --------------------------------------------------
#define MAINTESTNUM 0
#define ALIVE_TEST_NUM 0x12345678
#define ALIVE_TEST_OFFSET 0x1000
// --------------------------------------------------
// STATIC VARIABLES
// --------------------------------------------------
// I'm node 0
static int node = 0;
// This must match the test bench system clock period to get accurate sleep times in the software.
static int sysClkPeriodPs = 10000;
// --------------------------------------------------
// Hooks for auto-generated HAL
// --------------------------------------------------
uint32_t read_ext (uint32_t addr, uint32_t* data)
{
return csrReadMem(addr, data);
}
void write_ext (uint32_t addr, uint32_t data)
{
csrWriteMem(addr, data);
}
// --------------------------------------------------
// Read function to access memory over CSR bus
// --------------------------------------------------
uint32_t csrReadMem (uint32_t addr, uint32_t* data)
{
uint32_t rdata;
// Read over the AVS bus
VRead(addr, &rdata, NORMAL_UPDATE, node);
*data = rdata;
// Model some access rate time
VTick(AVS_ACCESS_LEN, node);
#ifdef DEBUG
VPrint("csrReadMem : addr = 0x%08x data = 0x%08x\n", addr, *data); fflush(NULL);
#endif
return 0;
}
// --------------------------------------------------
// Write function to access memory over CSR bus
// --------------------------------------------------
void csrWriteMem (uint32_t addr, uint32_t data)
{
#ifdef DEBUG
VPrint("csrWriteMem : addr = 0x%08x data = 0x%08x\n", addr, data); fflush(NULL);
#endif
// Write over the AVS bus for this node
VWrite(addr, data, NORMAL_UPDATE, node);
// Model some access rate time
VTick(AVS_ACCESS_LEN, node);
}
// --------------------------------------------------
// Read function to access memory directly (bypass sim)
// --------------------------------------------------
uint32_t directReadMem (uint32_t addr, uint32_t* data)
{
uint32_t rdata;
*data = ReadRamWord(addr, true, node);
#ifdef DEBUG
VPrint("directReadMem : addr = 0x%08x data = 0x%08x\n", addr, *data); fflush(NULL);
#endif
return 0;
}
// --------------------------------------------------
// Write function to access memory directly (bypass sim)
// --------------------------------------------------
void directWriteMem (uint32_t addr, uint32_t data)
{
#ifdef DEBUG
VPrint("directWriteMem : addr = 0x%08x data = 0x%08x\n", addr, data); fflush(NULL);
#endif
WriteRamWord(addr, data, true, node);
}
// --------------------------------------------------
// Simulation control functions
// --------------------------------------------------
void stopSim(bool error)
{
csrWriteMem(TB_SIM_CTRL_REG, TB_SIM_CTRL_STOP_MASK | (error ? TB_SIM_CTRL_ERROR_MASK : 0));
}
void finishSim(int error)
{
csrWriteMem(TB_SIM_CTRL_REG, TB_SIM_CTRL_FINISH_MASK | (error ? TB_SIM_CTRL_ERROR_MASK : 0));
}
void usleepSim(unsigned time)
{
VTick((time * 1000 * 1000)/sysClkPeriodPs, node);
}
void nsleepSim(unsigned time)
{
uint64_t time64 = time;
// Make ticks a minimum of 1, and do rounding to nearest clock period
uint32_t ticks = ((time64 * 1000) < (sysClkPeriodPs) ? 1 : (time64 * 1000 + sysClkPeriodPs/2)/sysClkPeriodPs);
VTick(ticks, node);
}
// ==================================================
// ENTRY POINT TO USER CODE FROM VPROC
// ==================================================
extern "C" void VUserMain0()
{
int error = 0;
int testnum = MAINTESTNUM;
uint32_t tmp1 = 0;
uint32_t tmp2 = 0;
CTestAuto* pTestBench = new CTestAuto((uint32_t*)(0));
VPrint("\n*****************************\n");
VPrint( "* Global Inkjet Systems *\n");
VPrint( "* Company run by idiots *\n");
VPrint( "* Virtual Processor (VProc) *\n");
VPrint( "* Copyright (c) 2020 *\n");
VPrint( "*****************************\n\n");
VPrint("Entered VUserMain%d()\n\n", node);
uint32_t clkFreqMHz = pTestBench->pConfigClkFreq->GetConfigClkFreq();
uint32_t sysClkPeriodPs = 1000000/clkFreqMHz;
// Parse arguments. As no argc and argv, pass in these as null, and it will look for
// vusermain.cfg, which should have a single line with the command line options. If this
// file doesn't exist, no parsing is done.
parseArgs(0, NULL, testnum);
usleepSim(1);
// Check we're alive by writing to memory over CSR bus
csrWriteMem(MEM_BASE_ADDR + ALIVE_TEST_OFFSET, ALIVE_TEST_NUM);
// Read back over CSR bus
csrReadMem (MEM_BASE_ADDR + ALIVE_TEST_OFFSET, &tmp1);
// Read directly from memory model (bypassing simulation)
directReadMem (MEM_BASE_ADDR + ALIVE_TEST_OFFSET, &tmp2);
if (tmp1 != ALIVE_TEST_NUM || tmp2 == ALIVE_TEST_NUM)
{
VPrint("\nVUserMain%d() failed start up memory access check\n\n", node);
error = 1;
}
// If start up check passed, run user test code
else
{
// Run the test code
switch(testnum)
{
case MAINTESTNUM :
// ##########################################
// # Call test code here
// (e.g. a runTest Class, with start method)
// ##########################################
break;
}
}
// Wait a bit
usleepSim(1);
// Tell the simulator to finish
VPrint("\nVUserMain%d() finishing with status %d\n\n", node, error);
finishSim(error);
// Sleep for ever, ticking. Don't exit or loop forever internally
// (e.g. while (1);) as simulation will hang.
SLEEP_FOREVER;
}

View file

@ -0,0 +1,49 @@
/**************************************************************/
/* VUserMain.h Date: 2018/08/09 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifndef _VUSERMAIN0_H_
#define _VUSERMAIN0_H_
extern "C" {
#include "VUser.h"
}
// Define VProc call normal and delta values
#define NORMAL_UPDATE 0
#define DELTA_UPDATE 1
// Define a sensible time for a register access, in clock cycles
// Note that for the AVS BFM, the actual length is AVS_ACCESS_LEN + 2
//#define AVS_ACCESS_LEN 10
#define AVS_ACCESS_LEN 2
// In simulation the base address for the register bus is 0
#define CORE_BASE_ADDR 0x00000000
// Define a sleep forever macro
#define SLEEP_FOREVER {while(1) VTick(0x7fffffff, node);}
// Exported library functions that aim to virtualise away VProc details
void stopSim (bool error);
void finishSim (int error);
void usleepSim (unsigned time);
void nsleepSim (unsigned time);
uint32_t csrReadMem (uint32_t addr, uint32_t* data);
void csrWriteMem (uint32_t addr, uint32_t data);
uint32_t directReadMem (uint32_t addr, uint32_t* data);
void directWriteMem (uint32_t addr, uint32_t data);
// Used by auto-generated HAL
extern "C" uint32_t read_ext (uint32_t addr, uint32_t* data);
extern "C" void write_ext (uint32_t addr, uint32_t data);
#endif

View file

@ -0,0 +1,110 @@
/*
* CTestAuto.h
*
* >>> AUTO-GENERATED. DO NOT EDIT. <<<
*
*/
#include <stdint.h>
#ifdef HDL_SIM
extern "C" uint32_t read_ext (uint32_t addr, uint32_t* data);
extern "C" void write_ext (uint32_t addr, uint32_t data);
#endif
#ifndef CTEST_AUTO_H_
#define CTEST_AUTO_H_
#include "test.h"
class CTestAuto
{
private:
// Single point read and write access methods to memory (allows overriding)
#ifdef HDL_SIM
inline static uint32_t readReg (volatile uint32_t* p_addr) {uint32_t addr, val; addr = (uint64_t)p_addr; read_ext(addr, &val); return val;};
inline static void writeReg(volatile uint32_t* p_addr, uint32_t val) {uint32_t addr = (uint64_t)p_addr; write_ext(addr, val);};
#else
inline static uint32_t readReg (volatile uint32_t* p_addr) {return *p_addr;};
inline static void writeReg(volatile uint32_t* p_addr, uint32_t val) {*p_addr = val;};
#endif
// Internal register class definitions
class CControl
{
public:
CControl(uint32_t* blkBaseAddr) {m_pvCsrBaseAddr = blkBaseAddr;};
inline uint32_t GetControl(){return CTestAuto::readReg(m_pvCsrBaseAddr + CSR_TEST_CONTROL/4);}
inline uint32_t GetError(){return (GetControl() & CSR_TEST_CONTROL_ERROR_MASK) >> CSR_TEST_CONTROL_ERROR;}
inline void SetError(uint32_t val){CTestAuto::writeReg(m_pvCsrBaseAddr + CSR_TEST_CONTROL/4, ((GetControl() & ~CSR_TEST_CONTROL_ERROR_MASK) | ((val << CSR_TEST_CONTROL_ERROR) & CSR_TEST_CONTROL_ERROR_MASK)));}
inline uint32_t GetDoStop(){return (GetControl() & CSR_TEST_CONTROL_DO_STOP_MASK) >> CSR_TEST_CONTROL_DO_STOP;}
inline void SetDoStop(uint32_t val){CTestAuto::writeReg(m_pvCsrBaseAddr + CSR_TEST_CONTROL/4, ((GetControl() & ~CSR_TEST_CONTROL_DO_STOP_MASK) | ((val << CSR_TEST_CONTROL_DO_STOP) & CSR_TEST_CONTROL_DO_STOP_MASK)));}
inline uint32_t GetDoFinish(){return (GetControl() & CSR_TEST_CONTROL_DO_FINISH_MASK) >> CSR_TEST_CONTROL_DO_FINISH;}
inline void SetDoFinish(uint32_t val){CTestAuto::writeReg(m_pvCsrBaseAddr + CSR_TEST_CONTROL/4, ((GetControl() & ~CSR_TEST_CONTROL_DO_FINISH_MASK) | ((val << CSR_TEST_CONTROL_DO_FINISH) & CSR_TEST_CONTROL_DO_FINISH_MASK)));}
inline uint32_t GetPartialTest(){return (GetControl() & CSR_TEST_CONTROL_PARTIAL_TEST_MASK) >> CSR_TEST_CONTROL_PARTIAL_TEST;}
inline void SetPartialTest(uint32_t val){CTestAuto::writeReg(m_pvCsrBaseAddr + CSR_TEST_CONTROL/4, ((GetControl() & ~CSR_TEST_CONTROL_PARTIAL_TEST_MASK) | ((val << CSR_TEST_CONTROL_PARTIAL_TEST) & CSR_TEST_CONTROL_PARTIAL_TEST_MASK)));}
inline void SetControl(uint32_t val){CTestAuto::writeReg(m_pvCsrBaseAddr + CSR_TEST_CONTROL/4, val);}
private:
volatile uint32_t* m_pvCsrBaseAddr;
};
class CTimeCount
{
public:
CTimeCount(uint32_t* blkBaseAddr) {m_pvCsrBaseAddr = blkBaseAddr;};
inline uint32_t GetTimeCount(){return CTestAuto::readReg(m_pvCsrBaseAddr + CSR_TEST_TIME_COUNT/4);}
private:
volatile uint32_t* m_pvCsrBaseAddr;
};
class CTimeout
{
public:
CTimeout(uint32_t* blkBaseAddr) {m_pvCsrBaseAddr = blkBaseAddr;};
inline uint32_t GetTimeout(){return CTestAuto::readReg(m_pvCsrBaseAddr + CSR_TEST_TIMEOUT/4);}
inline void SetTimeout(uint32_t val){CTestAuto::writeReg(m_pvCsrBaseAddr + CSR_TEST_TIMEOUT/4, val);}
private:
volatile uint32_t* m_pvCsrBaseAddr;
};
class CConfigClkFreq
{
public:
CConfigClkFreq(uint32_t* blkBaseAddr) {m_pvCsrBaseAddr = blkBaseAddr;};
inline uint32_t GetConfigClkFreq(){return CTestAuto::readReg(m_pvCsrBaseAddr + CSR_TEST_CONFIG_CLK_FREQ/4);}
private:
volatile uint32_t* m_pvCsrBaseAddr;
};
public:
// Constructor. Create register objects relative to the passed in base address
CTestAuto(uint32_t* csrBaseAddr = 0)
{
m_pvCsrBaseAddr = csrBaseAddr;
pControl = new CControl(csrBaseAddr + CSR_TEST_LOCAL/4);
pTimeCount = new CTimeCount(csrBaseAddr + CSR_TEST_LOCAL/4);
pTimeout = new CTimeout(csrBaseAddr + CSR_TEST_LOCAL/4);
pConfigClkFreq = new CConfigClkFreq(csrBaseAddr + CSR_TEST_LOCAL/4);
};
public:
// Pointers to the register objects
CControl* pControl;
CTimeCount* pTimeCount;
CTimeout* pTimeout;
CConfigClkFreq* pConfigClkFreq;
// Pointers to the sub-block objects
// Provide access to the base address used for this object
inline volatile uint32_t* GetCsrBaseAddr() {return m_pvCsrBaseAddr;}
private:
volatile uint32_t* m_pvCsrBaseAddr;
};
#endif /* CTEST_AUTO_H_ */

View file

@ -0,0 +1,32 @@
// Block name: test, using byte offsets
#include <stdint.h>
#ifndef __TEST_H__
#define __TEST_H__
#define CSR_TEST_UUT 0x00000000
#define CSR_TEST_MEMORY 0x20000000
#define CSR_TEST_LOCAL 0x60000000
#define CSR_TEST_CONTROL 0x00000000
#define CSR_TEST_CONTROL_ERROR 0
#define CSR_TEST_CONTROL_ERROR_WIDTH 1
#define CSR_TEST_CONTROL_ERROR_MASK 0x00000001
#define CSR_TEST_CONTROL_DO_STOP 1
#define CSR_TEST_CONTROL_DO_STOP_WIDTH 1
#define CSR_TEST_CONTROL_DO_STOP_MASK 0x00000002
#define CSR_TEST_CONTROL_DO_FINISH 2
#define CSR_TEST_CONTROL_DO_FINISH_WIDTH 1
#define CSR_TEST_CONTROL_DO_FINISH_MASK 0x00000004
#define CSR_TEST_CONTROL_PARTIAL_TEST 3
#define CSR_TEST_CONTROL_PARTIAL_TEST_WIDTH 1
#define CSR_TEST_CONTROL_PARTIAL_TEST_MASK 0x00000008
#define CSR_TEST_TIME_COUNT 0x00000004
#define CSR_TEST_TIMEOUT 0x00000008
#define CSR_TEST_CONFIG_CLK_FREQ 0x0000000c
#endif

View file

@ -0,0 +1,32 @@
/**************************************************************/
/* tb.h Date: 2018/08/9 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
#include <stdio.h>
#include <stdlib.h>
#ifndef _TB_H_
#define _TB_H_
// Address of physical memory where output data starts
#define START_PHY_MEM 0x20000000
#define MEM_BASE_ADDR START_PHY_MEM
// Test bench address for local registers
#define TB_BASE_ADDR 0x60000000
#define TB_SIM_CTRL_REG (TB_BASE_ADDR + 0)
#define TB_CAPTURE_ADDR (TB_BASE_ADDR + 4)
#define TB_IMG_WIDTH_PX (TB_BASE_ADDR + 8)
#define TB_SIM_CTRL_ERROR_MASK 0x00000001
#define TB_SIM_CTRL_STOP_MASK 0x00000002
#define TB_SIM_CTRL_FINISH_MASK 0x00000004
#define TEST_ERROR 1
#define NOERROR 0
#endif

View file

@ -0,0 +1,103 @@
/**************************************************************/
/* utils.cpp Date: 2018/11/09 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
// --------------------------------------------------
// DEFINES
// --------------------------------------------------
#define MAXARGS 100
#ifndef HDL_SIM
#define CFGFILENAME "host.cfg"
#else
#define CFGFILENAME "vusermain.cfg"
#endif
// --------------------------------------------------
// Parse configuration file arguments
// --------------------------------------------------
int parseArgs(int argcIn, char** argvIn, int &testnum)
{
int c;
int argc = 0;
char* argvBuf[MAXARGS];
char** argv = NULL;
char* argstr = NULL;
size_t len = 0;
char delim[2];
FILE* fp;
if (argcIn > 1)
{
argc = argcIn;
argv = argvIn;
}
else
{
fp = fopen(CFGFILENAME, "r");
if (fp == NULL)
return 1;
strcpy(delim, " ");
getline(&argstr, &len, fp);
strtok(argstr, delim);
fclose(fp);
if (argvBuf[0] != NULL)
{
argc = 1;
}
while((argvBuf[argc] = strtok(NULL, " ")) != NULL && argc < MAXARGS)
{
argc++;
}
argv = argvBuf;
}
testnum = 0;
int returnVal = 0;
opterr = 0;
while ((c = getopt (argc, argv, "ht:")) != -1)
{
switch (c)
{
case 't':
testnum = atoi(optarg);
break;
case 'h':
default:
printf("Usage: vusermain.cfg [-h] [-t <test num>]\n");
printf(" -t Specify test (default 0)\n");
printf("\n");
returnVal = 1;
break;
}
}
return returnVal;
}

View file

@ -0,0 +1,8 @@
/**************************************************************/
/* utils.h Date: 2018/11/09 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
extern int parseArgs (int argcIn, char** argvIn, int &testnum);

View file

@ -0,0 +1,318 @@
-------------------------------------------------------------------------------
-- Title : Core directed test bench top level
-- Project : GEOMETRY
-------------------------------------------------------------------------------
-- File : tb.vhd
-- Author : Simon Southwell
-- Company : Global Inkjet Systems
-- Created : 2018-06-01
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block is the top level test banch for the geometry-serializer
-------------------------------------------------------------------------------
-- Copyright (c) 2018 Global Inkjet Systems
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
library std;
use std.env.all;
use work.tb_pkg.all;
entity tb is
generic (
GUI_RUN : boolean := false;
CLK_FREQ_MHZ : natural range 1 to 1000 := 100
);
end entity;
architecture sim of tb is
---------------------------------------------
-- Signal declarations
---------------------------------------------
-- Clock signal
signal clk_x2 : std_logic;
signal clk : std_logic;
signal clk_div2 : std_logic;
signal count_vec : std_logic_vector(31 downto 0);
signal timeout : std_logic_vector(30 downto 0);
signal rst_n : std_logic;
-- AVS
signal avs_csr_address : std_logic_vector (31 downto 0);
signal avs_csr_writedata : std_logic_vector (31 downto 0);
signal avs_csr_readdata : std_logic_vector (31 downto 0);
signal avs_csr_write : std_logic;
signal avs_csr_read : std_logic;
signal avs_csr_write_uut : std_logic;
signal avs_csr_read_uut : std_logic;
signal avs_csr_readdata_uut : std_logic_vector (31 downto 0) := (others => '0');
signal avs_csr_write_mem : std_logic;
signal avs_csr_read_mem : std_logic;
signal avs_csr_readdata_mem : std_logic_vector (31 downto 0);
signal avs_csr_write_tb : std_logic;
signal avs_csr_read_tb : std_logic;
signal avs_csr_readdata_tb : std_logic_vector (31 downto 0);
-- Avalon Master read interface from memory model
signal avm_rx_waitrequest : std_logic;
signal avm_rx_burstcount : std_logic_vector (11 downto 0);
signal avm_rx_address : std_logic_vector (31 downto 0);
signal avm_rx_read : std_logic := '0';
signal avm_rx_readdata : std_logic_vector (31 downto 0);
signal avm_rx_readdatavalid : std_logic;
-- Avalon Master write interface to memory model
signal avm_tx_waitrequest : std_logic;
signal avm_tx_burstcount : std_logic_vector (11 downto 0);
signal avm_tx_address : std_logic_vector (31 downto 0);
signal avm_tx_write : std_logic := '0';
signal avm_tx_writedata : std_logic_vector (31 downto 0);
-- Memory model write port signals
signal wr_valid : std_logic := '0';
signal wr_data : std_logic_vector (31 downto 0);
signal wr_addr : std_logic_vector (31 downto 0);
-- Simuation control and status
signal error : std_logic;
signal do_stop : std_logic;
signal do_finish : std_logic;
signal partial_test : std_logic;
signal passed : boolean;
signal failed : boolean;
begin
-----------------------------------------
-- Test bench control
-----------------------------------------
tb_ctrl_inst : entity work.tb_ctrl
generic map(
GUI_RUN => GUI_RUN,
CLK_FREQ_MHZ => CLK_FREQ_MHZ
)
port map (
-- Clock and reset outputs
clk => clk,
clk_div2 => clk_div2,
clk_x2 => clk_x2,
rst_n => rst_n,
count_vec => count_vec,
timeout => '0' & timeout,
-- Status and control inputs
error => error,
do_stop => do_stop,
do_finish => do_finish,
partial_test => partial_test,
-- Test condition flags (for inspection externally)
failed => failed,
passed => passed
);
-----------------------------------------
-- Test bench address decode (auto-gen)
-----------------------------------------
test_csr_decode_inst : entity work.test_csr_decode
port map (
uut_write => avs_csr_write_uut,
uut_read => avs_csr_read_uut,
uut_readdata => avs_csr_readdata_uut,
local_write => avs_csr_write_tb,
local_read => avs_csr_read_tb,
local_readdata => avs_csr_readdata_tb,
memory_write => avs_csr_write_mem,
memory_read => avs_csr_read_mem,
memory_readdata => avs_csr_readdata_mem,
avs_address => avs_csr_address(28 downto 24),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
avs_readdata => avs_csr_readdata
);
-----------------------------------------
-- Local test bench registers (auto-gen)
-----------------------------------------
test_csr_regs_inst : entity work.test_csr_regs
generic map (
ADDR_DECODE_WIDTH => 5
)
port map (
clk => clk,
rst_n => rst_n,
control_error => error,
control_do_stop => do_stop,
control_do_finish => do_finish,
control_partial_test => partial_test,
config_clk_freq => std_logic_vector(to_unsigned(CLK_FREQ_MHZ, 9)),
time_count => count_vec,
timeout => timeout,
avs_address => avs_csr_address(4 downto 0),
avs_write => avs_csr_write_tb,
avs_writedata => avs_csr_writedata,
avs_read => avs_csr_read_tb,
avs_readdata => avs_csr_readdata_tb
);
-----------------------------------------
-- Virtual processor with Avalon bus
-----------------------------------------
vproc_inst : entity work.avsvproc
generic map (
NODE_NUM => 0,
AUTO_VALID_CSR => true, -- Generate a CSR bus read data valid internally
SEQ_PAGE => 4x"F"
)
port map (
clk => clk,
rst_n => rst_n,
-- Avalon memory mapped master interface
avs_csr_address => avs_csr_address,
avs_csr_write => avs_csr_write,
avs_csr_writedata => avs_csr_writedata,
avs_csr_read => avs_csr_read,
avs_csr_readdata => avs_csr_readdata
);
-----------------------------------------
-- Instantiation of memory model
-----------------------------------------
mem_model_inst : entity work.mem_model
port map (
clk => clk,
rst_n => rst_n,
avs_address => avs_csr_address,
avs_write => avs_csr_write_mem,
avs_writedata => avs_csr_writedata,
avs_read => avs_csr_read_mem,
avs_readdata => avs_csr_readdata_mem,
avm_rx_waitrequest => avm_rx_waitrequest,
avm_rx_burstcount => avm_rx_burstcount,
avm_rx_address => "0" & avm_rx_address(30 downto 0), -- Removed ACP bit
avm_rx_read => avm_rx_read,
avm_rx_readdata => avm_rx_readdata,
avm_rx_readdatavalid => avm_rx_readdatavalid,
avm_tx_waitrequest => avm_tx_waitrequest,
avm_tx_burstcount => avm_tx_burstcount,
avm_tx_address => avm_tx_address,
avm_tx_write => avm_tx_write,
avm_tx_writedata => avm_tx_writedata,
wr_port_valid_0 => wr_valid,
wr_port_data_0 => wr_data,
wr_port_addr_0 => wr_addr
);
-----------------------------------------
-- Instantiation of UUT
-----------------------------------------
-- ###########
-- # EXAMPLE #
-- ###########
-- core_inst : entity work.core
-- generic map (
-- EN_RX_AVM => true,
-- SLIM => true
-- )
-- port map (
-- clk => clk,
-- clk_x2 => clk_x2,
-- clk_div2 => clk_div2,
-- reset_n => rst_n,
--
-- avs_csr_address => avs_csr_address(15 downto 0),
-- avs_csr_write => avs_csr_write_uut,
-- avs_csr_writedata => avs_csr_writedata,
-- avs_csr_read => avs_csr_read_uut,
-- avs_csr_readdata => avs_csr_readdata_uut,
--
-- axm_awaddr => open,
-- axm_awprot => open,
-- axm_awvalid => open,
-- axm_awready => '1',
-- axm_wdata => open,
-- axm_wlast => open,
-- axm_wvalid => open,
-- axm_wready => '1',
-- axm_bvalid => '1',
-- axm_bready => open,
-- axm_araddr => avm_rx_address_axi,
-- axm_arlen => arlen,
-- axm_arsize => open,
-- axm_arburst => open,
-- axm_arcache => open,
-- axm_aruser => open,
-- axm_arprot => open,
-- axm_arvalid => avm_rx_read_axi,
-- axm_arready => axm_arready,
-- axm_rdata => avm_rx_readdata_axi,
-- axm_rvalid => avm_rx_readdatavalid_axi,
-- axm_rready => open,
--
-- avm_rx_waitrequest => avm_rx_waitrequest_raw,
-- avm_rx_burstcount => avm_rx_burstcount_raw,
-- avm_rx_address => avm_rx_address_raw,
-- avm_rx_read => avm_rx_read_raw,
-- avm_rx_readdata => avm_rx_readdata_raw,
-- avm_rx_readdatavalid => avm_rx_readdatavalid_raw,
--
-- avm_tx_waitrequest => avm_tx_waitrequest,
-- avm_tx_burstcount => avm_tx_burstcount,
-- avm_tx_address => avm_tx_address,
-- avm_tx_write => avm_tx_write,
-- avm_tx_writedata => avm_tx_writedata,
--
-- debug_out => debug
--
-- );
--
-- avm_rx_burstcount_axi <= "0000" & std_logic_vector(unsigned(arlen) + 1);
-- avm_rx_waitrequest_axi <= not axm_arready;
-- avm_rx_readdata_axi <= avm_rx_readdata;
-- avm_rx_readdatavalid_axi <= avm_rx_readdatavalid;
--
-- avm_rx_waitrequest_raw <= avm_rx_waitrequest;
-- avm_rx_readdata_raw <= avm_rx_readdata;
-- avm_rx_readdatavalid_raw <= avm_rx_readdatavalid;
--
-- avm_rx_burstcount <= avm_rx_burstcount_raw; -- avm_rx_burstcount_raw when avm_rx_read_raw = '1' else avm_rx_burstcount_axi;
-- avm_rx_address <= avm_rx_address_raw; -- avm_rx_address_raw when avm_rx_read_raw = '1' else avm_rx_address_axi;
-- avm_rx_read <= avm_rx_read_raw; -- avm_rx_read_axi or avm_rx_read_raw;
end architecture;

View file

@ -0,0 +1,161 @@
-------------------------------------------------------------------------------
-- Title : Core directed test bench control
-- Project : GEOMETRY
-------------------------------------------------------------------------------
-- File : tb.vhd
-- Author : Simon Southwell
-- Company : Global Inkjet Systems
-- Created : 2018-08-21
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block is test bench control block
-------------------------------------------------------------------------------
-- Copyright (c) 2018 Global Inkjet Systems
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
library std;
use std.env.all;
entity tb_ctrl is
generic (
GUI_RUN : boolean := false;
CLK_FREQ_MHZ : integer := 200
);
port (
-- Clock and reset outputs
clk_x2 : out std_logic;
clk : out std_logic := '1';
clk_div2 : out std_logic := '1';
rst_n : out std_logic := '0';
count_vec : out std_logic_vector(31 downto 0);
timeout : in std_logic_vector(31 downto 0);
-- Simulation status and control inputs
error : in std_logic;
do_stop : in std_logic;
do_finish : in std_logic;
partial_test : in std_logic;
-- External end-of-simulation flags
failed : out boolean;
passed : out boolean
);
end entity;
architecture sim of tb_ctrl is
package tb_pkg is new work.tb_pkg;
use tb_pkg.all;
signal clk_x2_e2 : std_logic := '1';
signal clk_x2_e1 : std_logic := '1';
signal clk_e1 : std_logic := '1';
signal is_gui_run : boolean := false;
signal count : integer := 0;
signal end_sim : std_logic;
begin
-----------------------------------------
-- Clock and reset generation
-----------------------------------------
-- Clock generation with concurrent procedure call
clk_gen(clk_x2_e2, Real(CLK_FREQ_MHZ) * 2.0E6); -- x2 clock
-- Export counter
count_vec <= std_logic_vector(to_unsigned(count, 32));
-- Derive system clock from master clock
process(clk_x2_e2)
begin
if clk_x2_e2'event and clk_x2_e2 = '1' then
clk_e1 <= not clk_e1;
end if;
end process;
process(clk_e1)
begin
if clk_e1'event and clk_e1 = '1' then
clk_div2 <= not clk_div2;
end if;
end process;
-- delta time corrections. All clocks should be in phase as per a PLL
clk_x2_e1 <= clk_x2_e2;
clk_x2 <= clk_x2_e1;
clk <= clk_e1;
-- Generate a reset
process (clk)
begin
if (clk'event and clk = '1') then
count <= count + 1;
rst_n <= '1' when count > 10 else '0';
end if;
end process ;
-- End-of-simulation signals
end_sim <= '1' when count = to_integer(unsigned(timeout)) or do_stop = '1' or do_finish = '1' else '0';
failed <= true when end_sim = '1' and (error = '1' or count = to_integer(unsigned(timeout))) else false;
passed <= true when end_sim = '1' and error = '0' else false;
-----------------------------------------
-- Simulation control from VProc over
-- CSR bus
-----------------------------------------
-- Set a flag that this is a GUI simulation if the generic GUI_RUN set to 'true' externally
GEN_GUI : if GUI_RUN generate
is_gui_run <= true;
end generate GEN_GUI;
PROC_TB_SIM_CTRL : process (clk, rst_n)
begin
if (rst_n = '0') then
elsif clk'event and clk = '1' then
-----------------------------------------
-- End simulation
-----------------------------------------
-- If end of simulation, stop
if end_sim = '1' then
if error = '1' then
report "*** FAIL: errors found" severity failure;
else
if count >= to_integer(unsigned(timeout)) then
report "*** FAIL: timeout" severity failure;
elsif partial_test = '1' then
report "NO FAILURES" severity note;
else
report "SUCCESS" severity note;
end if;
end if;
if is_gui_run or (do_stop = '1' and do_finish = '0') then
stop(0);
else
finish(0);
end if;
end if;
end if;
end process;
end architecture;

View file

@ -0,0 +1,106 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_arith.all;
package tb_pkg is
type mem_t is array (0 to 255) of std_logic_vector(31 downto 0);
type stripe_t is array (0 to 18*2*3) of std_logic_vector(31 downto 0);
-- Define the base locations of the test blocks on the CSR interface
constant AVS_CSR_UUT_BASE : integer := 16#00000000#;
constant AVS_CSR_MEM_BASE : integer := 16#40000000#;
constant AVS_CSR_TB_BASE : integer := 16#40010000#;
constant AVS_CASE_TB_SIM_CTRL_OFFSET : std_logic_vector( 3 downto 0) := 4x"0";
constant TEST_BYTE0 : std_logic_vector( 7 downto 0) := 8x"55";
constant TEST_BYTE1 : std_logic_vector( 7 downto 0) := 8x"AA";
constant TEST_BYTE2 : std_logic_vector( 7 downto 0) := 8x"5A";
constant TEST_WORD0 : std_logic_vector(31 downto 0) := 32x"cafebabe";
constant TEST_WORD1 : std_logic_vector(31 downto 0) := 32x"facef00c";
constant TEST_WORD2 : std_logic_vector(31 downto 0) := 32x"19661066";
constant TEST_WORD3 : std_logic_vector(31 downto 0) := 32x"18591905";
constant TEST_WORD4 : std_logic_vector(31 downto 0) := 32x"f2ae42b0";
constant TEST_WORD5 : std_logic_vector(31 downto 0) := 32x"c087bae5";
constant TEST_ADDR0 : std_logic_vector(23 downto 0) := 24x"123456";
constant TEST_ADDR1 : std_logic_vector(23 downto 0) := 24x"654321";
constant TEST_ADDR2 : std_logic_vector(23 downto 0) := 24x"250864";
-- Times (in clock ticks) for things to happen
constant AVS_ACCESS_LEN : integer := 20;
constant AVS_FAST_ACCESS_LEN : integer := 3;
procedure clk_gen(
signal clk : out std_logic;
constant FREQ : real);
procedure avs_write_proc (
constant addr : in integer;
variable data : in std_logic_vector(31 downto 0);
signal avs_wr : out std_logic;
signal avs_addr : out std_logic_vector(31 downto 0);
signal avs_wdata : out std_logic_vector(31 downto 0)
);
procedure avs_read_proc (
constant addr : in integer;
signal avs_rd : out std_logic;
signal avs_addr : out std_logic_vector(31 downto 0)
);
end tb_pkg;
package body tb_pkg is
---------------------------------------------
-- Procedure for clock generation
---------------------------------------------
procedure clk_gen(signal clk : out std_logic; constant FREQ : real) is
constant PERIOD : time := 1 sec / FREQ; -- Full period
constant HIGH_TIME : time := PERIOD / 2; -- High time
constant LOW_TIME : time := PERIOD - HIGH_TIME; -- Low time; always >= HIGH_TIME
begin
-- Generate a clock cycle
loop
clk <= '1';
wait for HIGH_TIME;
clk <= '0';
wait for LOW_TIME;
end loop;
end procedure;
---------------------------------------------
-- Procedure to write to slave bus
---------------------------------------------
procedure avs_write_proc (
constant addr : in integer;
variable data : in std_logic_vector(31 downto 0);
signal avs_wr : out std_logic;
signal avs_addr : out std_logic_vector(31 downto 0);
signal avs_wdata : out std_logic_vector(31 downto 0)
) is
begin
avs_wr <= '1';
avs_addr <= std_logic_vector(to_unsigned(addr, 32));
avs_wdata <= data;
end avs_write_proc;
---------------------------------------------
-- Procedure to instigate a read from AVS bus
---------------------------------------------
procedure avs_read_proc (
constant addr : in integer;
signal avs_rd : out std_logic;
signal avs_addr : out std_logic_vector(31 downto 0)
) is
begin
avs_rd <= '1';
avs_addr <= std_logic_vector(to_unsigned(addr, 32));
end avs_read_proc;
end tb_pkg;

View file

@ -0,0 +1,99 @@
-------------------------------------------------------------------------------
-- Title : TEST Block
-- Project : UNKNOWN
-------------------------------------------------------------------------------
-- File : test_csr_decode_auto.vhd
-- Author : auto-generated
-- Company : Global Inkjet Systems
-- Created : 2026-04-16
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block the top leve test bech
-------------------------------------------------------------------------------
-- Copyright (c) 2017, 2018 Global Inkjet Systems
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
----------------------- AUTO-GENERATED FILE. DO NOT EDIT ----------------------
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity test_csr_decode is
generic (
ADDR_DECODE_HI_BIT : natural range 1 to 32 := 28;
ADDR_DECODE_LO_BIT : natural range 1 to 32 := 24
);
port (
-- auto-generated
-- Decoded read/write strobes and returned read data
uut_write : out std_logic;
uut_read : out std_logic;
uut_readdata : in std_logic_vector(31 downto 0);
memory_write : out std_logic;
memory_read : out std_logic;
memory_readdata : in std_logic_vector(31 downto 0);
local_write : out std_logic;
local_read : out std_logic;
local_readdata : in std_logic_vector(31 downto 0);
-- end auto-generated
-- Avalon CSR slave interface
avs_address : in std_logic_vector(ADDR_DECODE_HI_BIT downto ADDR_DECODE_LO_BIT);
avs_write : in std_logic;
avs_read : in std_logic;
avs_readdata : out std_logic_vector(31 downto 0)
);
end entity;
architecture rtl of test_csr_decode is
begin
-- auto-generated
avs_readdata <= uut_readdata or memory_readdata or local_readdata;
-- end auto-generated
process(all) is
begin
-- auto-generated
uut_write <= '0';
uut_read <= '0';
memory_write <= '0';
memory_read <= '0';
local_write <= '0';
local_read <= '0';
case avs_address is
when std_logic_vector(to_unsigned(0, 5)) =>
uut_write <= avs_write;
uut_read <= avs_read;
when std_logic_vector(to_unsigned(8, 5)) =>
memory_write <= avs_write;
memory_read <= avs_read;
when std_logic_vector(to_unsigned(24, 5)) =>
local_write <= avs_write;
local_read <= avs_read;
when others =>
null;
end case;
-- end auto-generated
end process;
end rtl;

View file

@ -0,0 +1,222 @@
-------------------------------------------------------------------------------
-- Title : TEST Block
-- Project : UNKNOWN
-------------------------------------------------------------------------------
-- File : test_csr_regs_auto.vhd
-- Author : auto-generated
-- Company : Global Inkjet Systems
-- Created : 2026-04-16
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block the top leve test bech
-------------------------------------------------------------------------------
-- Copyright (c) 2017, 2018 Global Inkjet Systems
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
----------------------- AUTO-GENERATED FILE. DO NOT EDIT ----------------------
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.test_pkg.all;
entity test_csr_regs is
generic (
ADDR_DECODE_WIDTH : natural range 1 to 32 := 8
);
port (
-- Clock and reset
clk : in std_logic;
rst_n : in std_logic;
-- auto-generated
-- Internal signal ports
control_error : out std_logic;
control_do_stop : out std_logic;
control_do_finish : out std_logic;
control_partial_test : out std_logic;
timeout : out std_logic_vector (30 downto 0);
time_count : in std_logic_vector (31 downto 0);
config_clk_freq : in std_logic_vector (8 downto 0);
-- end auto-generated
-- Slave bus port
avs_address : in std_logic_vector(ADDR_DECODE_WIDTH-1 downto 0);
avs_write : in std_logic;
avs_writedata : in std_logic_vector(31 downto 0);
avs_read : in std_logic;
avs_readdata : out std_logic_vector(31 downto 0)
);
end entity;
architecture rtl of test_csr_regs is
signal next_avs_readdata : std_logic_vector(31 downto 0);
signal avs_readdata_reg : std_logic_vector(31 downto 0);
-- auto-generated
signal control_error_reg : std_logic;
signal control_do_stop_reg : std_logic;
signal control_do_finish_reg : std_logic;
signal control_partial_test_reg : std_logic;
signal timeout_reg : std_logic_vector (30 downto 0);
signal next_control_error : std_logic;
signal next_control_do_stop : std_logic;
signal next_control_do_finish : std_logic;
signal next_control_partial_test : std_logic;
signal next_timeout : std_logic_vector (30 downto 0);
-- end auto-generated
begin
-- Export registers interface read data to output port
avs_readdata <= avs_readdata_reg;
-- auto-generated
-- Export internal write registers to output ports
control_error <= control_error_reg;
control_do_stop <= control_do_stop_reg;
control_do_finish <= control_do_finish_reg;
control_partial_test <= control_partial_test_reg;
timeout <= timeout_reg;
-- Export AVS write bus to write pulse register ports
-- end auto-generated
-- Process to calculate next state, generate output read/write pulses
-- and write pulse register output
process (all)
begin
-- Default reads to 0. (Allows ORing of busses.)
next_avs_readdata <= (others => '0');
-- auto-generated
-- Default the internal write register next values to be current state
next_control_error <= control_error_reg;
next_control_do_stop <= control_do_stop_reg;
next_control_do_finish <= control_do_finish_reg;
next_control_partial_test <= control_partial_test_reg;
next_timeout <= timeout_reg;
-- Default the write-clear register next values to 0
-- Default the read- and write-pulse register pulse outputs to 0
-- end auto-generated
-- Bus write active
if avs_write = '1' then
case avs_address is
-- auto-generated
-- Write (and write pulse) register case statements
when CSR_CONTROL_ADDR =>
next_control_do_finish <= avs_writedata(2);
next_control_do_stop <= avs_writedata(1);
next_control_error <= avs_writedata(0);
next_control_partial_test <= avs_writedata(3);
when CSR_TIMEOUT_ADDR =>
next_timeout <= avs_writedata(30 downto 0);
when others =>
null;
-- end auto-generated
end case;
end if;
-- Bus read active
if avs_read = '1' then
-- Default the next_avs_readdata to 0
next_avs_readdata <= x"00000000";
case avs_address(ADDR_DECODE_WIDTH-1 downto 0) is
-- auto-generated
-- Write and read (incl. constant) case statements
when CSR_CONFIG_CLK_FREQ_ADDR =>
next_avs_readdata(8 downto 0) <= config_clk_freq;
when CSR_CONTROL_ADDR =>
next_avs_readdata(2) <= control_do_finish_reg;
next_avs_readdata(1) <= control_do_stop_reg;
next_avs_readdata(0) <= control_error_reg;
next_avs_readdata(3) <= control_partial_test_reg;
when CSR_TIME_COUNT_ADDR =>
next_avs_readdata(31 downto 0) <= time_count;
when CSR_TIMEOUT_ADDR =>
next_avs_readdata(30 downto 0) <= timeout_reg;
-- end auto-generated
-- Default an active read on non-existent register
when others =>
next_avs_readdata <= x"00000000";
end case;
end if;
end process;
-- Process to update internal state
process (clk, rst_n)
begin
if rst_n = '0' then
avs_readdata_reg <= (others => '0');
-- auto-generated
-- Reset internal write registers
control_error_reg <= '0';
control_do_stop_reg <= '0';
control_do_finish_reg <= '0';
control_partial_test_reg <= '0';
timeout_reg <= std_logic_vector(to_unsigned(16#00989680#, 31));
-- end auto-generated
elsif (clk'event and clk = '1') then
avs_readdata_reg <= next_avs_readdata;
-- auto-generated
-- Internal write register state updates
control_error_reg <= next_control_error;
control_do_stop_reg <= next_control_do_stop;
control_do_finish_reg <= next_control_do_finish;
control_partial_test_reg <= next_control_partial_test;
timeout_reg <= next_timeout;
-- end auto-generated
end if;
end process;
end rtl;

View file

@ -0,0 +1,34 @@
-- Block name: test
-- And now for some register addresses...
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package test_pkg is
constant CSR_UUT_ADDR : std_logic_vector(31 downto 0) := 32x"00000000";
constant CSR_UUT_ADDR_INT : integer := 16#00000000#;
constant CSR_MEMORY_ADDR : std_logic_vector(31 downto 0) := 32x"08000000";
constant CSR_MEMORY_ADDR_INT : integer := 16#08000000#;
constant CSR_LOCAL_ADDR : std_logic_vector(31 downto 0) := 32x"18000000";
constant CSR_LOCAL_ADDR_INT : integer := 16#18000000#;
constant CSR_CONTROL_ADDR : std_logic_vector(4 downto 0) := 5x"00";
constant CSR_CONTROL_ADDR_US : unsigned(4 downto 0) := 5x"00";
constant CSR_CONTROL_ADDR_INT : integer := 16#00000000#;
constant CSR_CONTROL_ERROR : integer := 0;
constant CSR_CONTROL_DO_STOP : integer := 1;
constant CSR_CONTROL_DO_FINISH : integer := 2;
constant CSR_CONTROL_PARTIAL_TEST : integer := 3;
constant CSR_TIME_COUNT_ADDR : std_logic_vector(4 downto 0) := 5x"01";
constant CSR_TIME_COUNT_ADDR_US : unsigned(4 downto 0) := 5x"01";
constant CSR_TIME_COUNT_ADDR_INT : integer := 16#00000001#;
constant CSR_TIMEOUT_ADDR : std_logic_vector(4 downto 0) := 5x"02";
constant CSR_TIMEOUT_ADDR_US : unsigned(4 downto 0) := 5x"02";
constant CSR_TIMEOUT_ADDR_INT : integer := 16#00000002#;
constant CSR_CONFIG_CLK_FREQ_ADDR : std_logic_vector(4 downto 0) := 5x"03";
constant CSR_CONFIG_CLK_FREQ_ADDR_US : unsigned(4 downto 0) := 5x"03";
constant CSR_CONFIG_CLK_FREQ_ADDR_INT : integer := 16#00000003#;
end package test_pkg;

View file

@ -0,0 +1,2 @@
# do sim.do
# sim.do -cpppath /usr/bin

View file

@ -0,0 +1 @@
vusermain0 -t 0

View file

@ -0,0 +1,52 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate /tb/clk_x2
add wave -noupdate /tb/clk
add wave -noupdate /tb/clk_div2
add wave -noupdate /tb/rst_n
add wave -noupdate /tb/do_finish
add wave -noupdate /tb/do_stop
add wave -noupdate /tb/error
add wave -noupdate /tb/failed
add wave -noupdate /tb/passed
add wave -noupdate -radix unsigned /tb/count_vec
add wave -noupdate -radix unsigned /tb/timeout
add wave -noupdate /tb/avm_rx_read
add wave -noupdate -radix hexadecimal -childformat {{/tb/avm_rx_readdata(31) -radix hexadecimal} {/tb/avm_rx_readdata(30) -radix hexadecimal} {/tb/avm_rx_readdata(29) -radix hexadecimal} {/tb/avm_rx_readdata(28) -radix hexadecimal} {/tb/avm_rx_readdata(27) -radix hexadecimal} {/tb/avm_rx_readdata(26) -radix hexadecimal} {/tb/avm_rx_readdata(25) -radix hexadecimal} {/tb/avm_rx_readdata(24) -radix hexadecimal} {/tb/avm_rx_readdata(23) -radix hexadecimal} {/tb/avm_rx_readdata(22) -radix hexadecimal} {/tb/avm_rx_readdata(21) -radix hexadecimal} {/tb/avm_rx_readdata(20) -radix hexadecimal} {/tb/avm_rx_readdata(19) -radix hexadecimal} {/tb/avm_rx_readdata(18) -radix hexadecimal} {/tb/avm_rx_readdata(17) -radix hexadecimal} {/tb/avm_rx_readdata(16) -radix hexadecimal} {/tb/avm_rx_readdata(15) -radix hexadecimal} {/tb/avm_rx_readdata(14) -radix hexadecimal} {/tb/avm_rx_readdata(13) -radix hexadecimal} {/tb/avm_rx_readdata(12) -radix hexadecimal} {/tb/avm_rx_readdata(11) -radix hexadecimal} {/tb/avm_rx_readdata(10) -radix hexadecimal} {/tb/avm_rx_readdata(9) -radix hexadecimal} {/tb/avm_rx_readdata(8) -radix hexadecimal} {/tb/avm_rx_readdata(7) -radix hexadecimal} {/tb/avm_rx_readdata(6) -radix hexadecimal} {/tb/avm_rx_readdata(5) -radix hexadecimal} {/tb/avm_rx_readdata(4) -radix hexadecimal} {/tb/avm_rx_readdata(3) -radix hexadecimal} {/tb/avm_rx_readdata(2) -radix hexadecimal} {/tb/avm_rx_readdata(1) -radix hexadecimal} {/tb/avm_rx_readdata(0) -radix hexadecimal}} -subitemconfig {/tb/avm_rx_readdata(31) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(30) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(29) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(28) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(27) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(26) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(25) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(24) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(23) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(22) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(21) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(20) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(19) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(18) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(17) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(16) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(15) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(14) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(13) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(12) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(11) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(10) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(9) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(8) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(7) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(6) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(5) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(4) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(3) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(2) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(1) {-height 17 -radix hexadecimal} /tb/avm_rx_readdata(0) {-height 17 -radix hexadecimal}} /tb/avm_rx_readdata
add wave -noupdate /tb/avm_rx_readdatavalid
add wave -noupdate /tb/avm_rx_waitrequest
add wave -noupdate /tb/avm_tx_waitrequest
add wave -noupdate /tb/avm_tx_write
add wave -noupdate -radix hexadecimal /tb/avs_csr_address
add wave -noupdate /tb/avs_csr_write
add wave -noupdate -radix hexadecimal /tb/avs_csr_writedata
add wave -noupdate /tb/avs_csr_read
add wave -noupdate -radix hexadecimal /tb/avs_csr_readdata
add wave -noupdate /tb/avs_csr_write_mem
add wave -noupdate /tb/avs_csr_read_mem
add wave -noupdate -radix hexadecimal /tb/avs_csr_readdata_mem
add wave -noupdate /tb/avs_csr_write_tb
add wave -noupdate /tb/avs_csr_read_tb
add wave -noupdate -radix hexadecimal /tb/avs_csr_readdata_tb
add wave -noupdate /tb/avs_csr_write_uut
add wave -noupdate /tb/avs_csr_read_uut
add wave -noupdate -radix hexadecimal /tb/avs_csr_readdata_uut
add wave -noupdate /tb/wr_valid
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {2286100 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 199
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 {2253900 ps} {2344600 ps}

View file

@ -0,0 +1,494 @@
m255
K4
z2
!s11e vcom 2020.1 2020.02, Feb 28 2020
13
!s112 1.1
!i10d 8192
!i10e 25
!i10f 100
cModel Technology
Z0 d/mnt/c/Projects/fpgapei/fpgahome/firmware/top/src/test
Eavsvproc
Z1 w1775847054
Z2 DPx4 ieee 11 numeric_std 0 22 aU^R8eGcicLcUFIaBQSL>3
Z3 DPx3 std 6 textio 0 22 zE1`LPoLg^DX3Oz^4Fj1K3
Z4 DPx4 ieee 14 std_logic_1164 0 22 cVAk:aDinOX8^VGI1ekP<3
!i122 0
R0
Z5 8/mnt/c/Projects/firmware_tools/verification/vproc/avsvproc.vhd
Z6 F/mnt/c/Projects/firmware_tools/verification/vproc/avsvproc.vhd
l0
L8 1
VFICYS75dUe9WDFi:H_l9m3
!s100 aO=SmT696i_bo]63KQ]>j1
Z7 OV;C;2020.1;71
33
Z8 !s110 1776369949
!i10b 1
Z9 !s108 1776369949.000000
Z10 !s90 -quiet|-2008|-f|files.tcl|-work|work|
!s107 ./tb.vhd|./tb_ctrl.vhd|./tb_pkg.vhd|/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model.vhd|/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model_pkg.vhd|/mnt/c/Projects/firmware_tools/verification/vproc/avsvproc.vhd|/mnt/c/Projects/firmware_tools/verification/vproc/vproc.vhd|/mnt/c/Projects/firmware_tools/verification/vproc/vproc_pkg.vhd|./test_csr_regs_auto.vhd|./test_csr_decode_auto.vhd|./test_pkg_auto.vhd|
!i113 1
Z11 o-quiet -2008 -work work
Z12 tExplicit 1 CvgOpt 0
Abehavioural
Z13 DPx4 work 9 vproc_pkg 0 22 j1[ZS902iW]^R49<dC7;f1
Z14 DEx4 work 5 vproc 0 22 =k^NgKjG66hN]gW15V>jm1
R2
R3
R4
Z15 DEx4 work 8 avsvproc 0 22 FICYS75dUe9WDFi:H_l9m3
!i122 0
l57
L39 98
Vi;k0hBF8Na?O47Z6k9=V;3
!s100 4QO1Mlb5A4]dSG?:4bYk]1
R7
33
R8
!i10b 1
R9
R10
Z16 !s107 ./tb.vhd|./tb_ctrl.vhd|./tb_pkg.vhd|/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model.vhd|/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model_pkg.vhd|/mnt/c/Projects/firmware_tools/verification/vproc/avsvproc.vhd|/mnt/c/Projects/firmware_tools/verification/vproc/vproc.vhd|/mnt/c/Projects/firmware_tools/verification/vproc/vproc_pkg.vhd|./test_csr_regs_auto.vhd|./test_csr_decode_auto.vhd|./test_pkg_auto.vhd|
!i113 1
R11
R12
Emem_model
R1
Z17 DPx4 work 13 mem_model_pkg 0 22 @V^WBC<DLFGD3nT`e6FcL1
R2
R3
R4
!i122 0
R0
Z18 8/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model.vhd
Z19 F/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model.vhd
l0
L25 1
V5z9?EVMRZ^`YT2M4X^P522
!s100 zCYIKhM?X]UPI<TLd>dG13
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Amodel
R17
R2
R3
R4
Z20 DEx4 work 9 mem_model 0 22 5z9?EVMRZ^`YT2M4X^P522
!i122 0
l92
L90 211
VQ`4dDf_4Rh;L;;QKcLzEE2
!s100 aYli<z_l=?52Qm]@6CkTJ1
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Pmem_model_pkg
R3
R4
!i122 0
R1
R0
Z21 8/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model_pkg.vhd
Z22 F/mnt/c/Projects/firmware_tools/verification/mem_model/mem_model_pkg.vhd
l0
L21 1
V@V^WBC<DLFGD3nT`e6FcL1
!s100 [0_VmZ?zeed?SWXBaom4_0
R7
33
b1
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Bbody
R17
R3
R4
!i122 0
l0
L39 1
VEo6KI5mgPe1>TjGmibf9_1
!s100 8O=ngdbm57YPRdQm^E0LE2
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Etb
Z23 w1776011250
Z24 DPx4 ieee 15 std_logic_arith 0 22 [G314=:2zXJ`VORJe1J@Z1
Z25 DPx4 work 6 tb_pkg 0 22 ]fgeWHMLkY]WS=ZY8dOH?2
Z26 DPx3 std 3 env 0 22 d?`1ck@NdeD@H3RZG7FgZ2
Z27 DPx8 synopsys 10 attributes 0 22 dc>JdEHRM@6GGENe5bZ?D1
Z28 DPx4 ieee 14 std_logic_misc 0 22 dN]HY6l5ohPcZ:TaC@B;53
R2
R3
R4
!i122 0
R0
Z29 8./tb.vhd
Z30 F./tb.vhd
l0
L28 1
VN^a]A3R3MhKn4^kYgE9D;3
!s100 3cdZ[dl_QVlLKDBN1aL`F1
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Asim
R17
R20
R15
Z31 DPx4 work 8 test_pkg 0 22 05;76`ccTI43TjS44mkVZ3
Z32 DEx4 work 13 test_csr_regs 0 22 iVM:agzz6dP3iW4>Oe5:Z3
Z33 DEx4 work 15 test_csr_decode 0 22 fmz6C9FW>M`TF:AajU:S72
Z34 DEx4 work 7 tb_ctrl 0 22 WV3L_i@gzCXbCXZ<0>icU2
R24
R25
R26
R27
R28
R2
R3
R4
DEx4 work 2 tb 0 22 N^a]A3R3MhKn4^kYgE9D;3
!i122 0
l96
L35 284
VTV=33M[Uia7Wz^A`K<Q=O0
!s100 JQ1HaLikhW;HMCHhHY_8]2
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Etb_ctrl
Z35 w1775921585
R26
R27
R28
R2
R3
R4
!i122 0
R0
Z36 8./tb_ctrl.vhd
Z37 F./tb_ctrl.vhd
l0
Z38 L27 1
VWV3L_i@gzCXbCXZ<0>icU2
!s100 HhC7YbmH@[zh5kQjB=_NG0
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Asim
R24
R25
R26
R27
R28
R2
R3
R4
R34
!i122 0
l69
L56 106
VjS;22IbJ9ZU2O>[Gn1hDL2
!s100 X]g2<mH[9l>`ZNNEN`UP[1
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Ptb_pkg
R24
Z39 DBx4 ieee 11 numeric_std 4 body 22 g_7F]fA0eD^jGFXGLS>z40
R3
R4
!i122 0
R35
R0
Z40 8./tb_pkg.vhd
Z41 F./tb_pkg.vhd
l0
L7 1
V]fgeWHMLkY]WS=ZY8dOH?2
!s100 kF]]20?mJCTGDHM4Y@VbG0
R7
33
b1
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Bbody
R25
R24
R39
R3
R4
!i122 0
l0
L58 1
V@95Vk^eSnL^DA;OJ6PF<20
!s100 ?78o_]APYh<g?jNBSg9253
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Etest_csr_decode
Z42 w1776369944
R2
R3
R4
!i122 0
R0
Z43 8./test_csr_decode_auto.vhd
Z44 F./test_csr_decode_auto.vhd
l0
R38
Vfmz6C9FW>M`TF:AajU:S72
!s100 cEh?A]2EJUU_A9[m3<zDa3
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Artl
R2
R3
R4
R33
!i122 0
l60
L58 42
Vhj`9;bC]6MjeiCIUoWRD82
!s100 cYYn]Ua[cZnYe9LI>HP1>0
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Etest_csr_regs
R42
R31
R2
R3
R4
!i122 0
R0
Z45 8./test_csr_regs_auto.vhd
Z46 F./test_csr_regs_auto.vhd
l0
L29 1
ViVM:agzz6dP3iW4>Oe5:Z3
!s100 cXgA4kQlUz2n<m8MG^@861
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Artl
R31
R2
R3
R4
R32
!i122 0
l81
L61 161
VhT2Z7@QhImdhI47XlfF=k1
!s100 @6?OR6E@[2DZhK7?E`EBH1
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Ptest_pkg
R2
R3
R4
!i122 0
R42
R0
8./test_pkg_auto.vhd
F./test_pkg_auto.vhd
l0
L8 1
V05;76`ccTI43TjS44mkVZ3
!s100 =Xj5<:;4Plaf>e^HjD;AZ2
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Evproc
R1
R13
R2
R3
R4
!i122 0
R0
Z47 8/mnt/c/Projects/firmware_tools/verification/vproc/vproc.vhd
Z48 F/mnt/c/Projects/firmware_tools/verification/vproc/vproc.vhd
l0
L19 1
V=k^NgKjG66hN]gW15V>jm1
!s100 GWeRfUnKCNJMgh@;VTnSc0
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Amodel
R13
R2
R3
R4
R14
!i122 0
l44
L36 145
V0Y9Z1HnkbSS4o`8L9a:H53
!s100 9O]9JSBBNW@R_JA[Xj5]U2
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Pvproc_pkg
!i122 0
R1
R0
Z49 8/mnt/c/Projects/firmware_tools/verification/vproc/vproc_pkg.vhd
Z50 F/mnt/c/Projects/firmware_tools/verification/vproc/vproc_pkg.vhd
l0
L18 1
Vj1[ZS902iW]^R49<dC7;f1
!s100 OVUz[bLTIggMOmGN]L[Eb0
R7
33
b1
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12
Bbody
R13
!i122 0
l0
L52 1
V4?;GWfnkNE<@><KLb>AUS1
!s100 =ok97FOH^6azm25k?X5G?1
R7
33
R8
!i10b 1
R9
R10
R16
!i113 1
R11
R12

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,4 @@
m255
K4
z0
cModel Technology

660
firmware/top/src/top.vhd Normal file
View file

@ -0,0 +1,660 @@
-------------------------------------------------------------------------------
--! @file
--! @brief SOM FPGA top level for SG600
--!
--! @details This block is the top level for the logic of the SG600. It has
--! all the ports for the product, and instantiates the QSYS generated
--! top_system with all the exported signals---both logic and HPS that
--! need connecting to non-standard pins. HPS restes are generated at this level
--! and some tristate control.
--!
--! @b Clock/resets:
--! @li FPGA_CLK_25 : Reference clock for PLL for logic clock generation
--! @li FPGA_CLK_19VM : High accuracy clock for netforx (when implemented)
--!
--! @b Interfaces:
--! @li memory_mem_* : HPS DDR SDRAM interface
--! @li hps_emac0|1 : HPS ethernet interface
--! @li hps_sdio_* : HSP SDIO interface for flash
--! @li hps_GPIO : HPS GPIO for power, LED control, resets etc.
--! @li SCL_*/SDA_* : I2C masters interfaces for SOM and HMB devices
--! @li P_*_GOOD : Power status inputs
--! @li TIMING_* : Timing bus
--! @li LED : SOM LED outputs
--! @li STM8_* : STM* measure triggers and alerts
--! @li SWIM : ST SWIM interface for configuring the SOM's STM8
--! @li HOST_*_EN : host power enables
--! @li RX_P|N : uncommitted connector pins used for DAC control (incl. SPI) and AMP control on SG600
--! @li TX_P|N : Serialised LVDS signalling for communicating print data to SG600 HMB board
--! @li TX_P|N_SSE : Single ended use of uncommitted pins for head control
--!
--! @b Clock-crossing considerations:
--! @li No clocked logic at this level
--!
--! @b Language build standard requirements:
--! @li VHDL 2008
--!
--! @author Simon Southwell
--! @copyright (c) 2017, 2018 Global Inkjet Systems
--! @date 2017-12-18
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library top_system;
use work.top_pkg.all;
entity top is
port(
memory_mem_a : out std_logic_vector(14 downto 0);
memory_mem_ba : out std_logic_vector(2 downto 0);
memory_mem_ck : out std_logic;
memory_mem_ck_n : out std_logic;
memory_mem_cke : out std_logic;
memory_mem_cs_n : out std_logic;
memory_mem_ras_n : out std_logic;
memory_mem_cas_n : out std_logic;
memory_mem_we_n : out std_logic;
memory_mem_reset_n : out std_logic;
memory_mem_dq : inout std_logic_vector(31 downto 0);
memory_mem_dqs : inout std_logic_vector(3 downto 0);
memory_mem_dqs_n : inout std_logic_vector(3 downto 0);
memory_mem_odt : out std_logic;
memory_mem_dm : out std_logic_vector(3 downto 0);
memory_oct_rzqin : in std_logic;
hps_emac0_TX_CLK : out std_logic;
hps_emac0_TXD0 : out std_logic;
hps_emac0_TXD1 : out std_logic;
hps_emac0_TXD2 : out std_logic;
hps_emac0_TXD3 : out std_logic;
hps_emac0_RXD0 : in std_logic;
hps_emac0_MDIO : inout std_logic;
hps_emac0_MDC : inout std_logic;
hps_emac0_RX_CTL : in std_logic;
hps_emac0_TX_CTL : out std_logic;
hps_emac0_RX_CLK : in std_logic;
hps_emac0_RXD1 : in std_logic;
hps_emac0_RXD2 : in std_logic;
hps_emac0_RXD3 : in std_logic;
hps_emac1_TX_CLK : out std_logic;
hps_emac1_TXD0 : out std_logic;
hps_emac1_TXD1 : out std_logic;
hps_emac1_TXD2 : out std_logic;
hps_emac1_TXD3 : out std_logic;
hps_emac1_RXD0 : in std_logic;
hps_emac1_MDIO : inout std_logic;
hps_emac1_MDC : inout std_logic;
hps_emac1_RX_CTL : in std_logic;
hps_emac1_TX_CTL : out std_logic;
hps_emac1_RX_CLK : in std_logic;
hps_emac1_RXD1 : in std_logic;
hps_emac1_RXD2 : in std_logic;
hps_emac1_RXD3 : in std_logic;
hps_sdio_CLK : out std_logic;
hps_sdio_CMD : inout std_logic;
hps_sdio_D0 : inout std_logic;
hps_sdio_D1 : inout std_logic;
hps_sdio_D2 : inout std_logic;
hps_sdio_D3 : inout std_logic;
hps_sdio_D4 : inout std_logic;
hps_sdio_D5 : inout std_logic;
hps_sdio_D6 : inout std_logic;
hps_sdio_D7 : inout std_logic;
hps_GPIO : inout std_logic_vector(24 downto 0);
SCL_SOM : inout std_logic;
SDA_SOM : inout std_logic;
SCL_APP : inout std_logic;
SDA_APP : inout std_logic;
FPGA_CLK_25 : in std_logic;
FPGA_CLK_19M2 : in std_logic;
P_GOOD : inout std_logic;
P_IN_GOOD : inout std_logic;
P_HOST_GOOD : inout std_logic;
LED : out std_logic_vector(5 downto 1);
TIMING_TX_P : out std_logic;
TIMING_TX_N : in std_logic;
TIMING_RX_P : in std_logic;
TIMING_RX_N : out std_logic;
STM8_ALERT_TX : inout std_logic;
STM8_TRIGGER_RX : inout std_logic;
SWIM : inout std_logic; -- SWIM Interface to SOM STM8 (and cascaded to Host)
HOST_5V_EN : out std_logic;
HOST_3V3_EN : out std_logic;
HOST_2V5_EN : out std_logic;
HOST_1V5_EN : out std_logic;
HOST_1V2_EN : out std_logic;
HOST_1V1_EN : out std_logic;
RX_P : inout std_logic_vector(27 downto 0);
RX_N : inout std_logic_vector(27 downto 0);
TX_P : out std_logic_vector(16 downto 0);
TX_P_SSE : inout std_logic_vector(28 downto 17);
TX_N_SSE : inout std_logic_vector(28 downto 17);
HOST_PWR_EN : out std_logic;
NC : in std_logic_vector(6 downto 0)
);
end entity top;
architecture rtl of top is
------------------------------------------------------------------------------
-- Signal declarations
------------------------------------------------------------------------------
signal hps_reset_n : std_logic;
signal pio_in : std_logic_vector(31 downto 0);
signal pio_out : std_logic_vector(31 downto 0);
signal swim_tx : std_logic_vector(4 downto 0);
signal swim_rx : std_logic_vector(4 downto 0);
signal fpga_cfg_dclk : std_logic;
signal fpga_cfg_data : std_logic;
signal fpga_cfg_done : std_logic;
signal fpga_cfg_nstatus : std_logic;
signal fpga_cfg_nconfig : std_logic;
signal fpga_cfg_init_done : std_logic;
signal fpga_cfg_oe : std_logic;
signal fan_sense : std_logic;
signal heater_en : std_logic_vector(3 downto 0);
signal fan_pwm : std_logic;
signal hv_clk_phase0 : std_logic;
signal hv_clk_phase90 : std_logic;
signal hv_clk_phase180 : std_logic;
signal hv_clk_phase270 : std_logic;
signal lvds_tx_tmp : std_logic_vector(29 downto 0);
signal hps_reset_req : std_logic_vector(2 downto 0);
signal hps_cold_reset : std_logic;
signal hps_cold_reset_n : std_logic;
signal hps_warm_reset : std_logic;
signal hps_warm_reset_n : std_logic;
signal hps_debug_reset : std_logic;
signal hps_debug_reset_n : std_logic;
signal hps_0_h2f_loan_io_in : std_logic_vector(66 downto 0);
signal hps_0_h2f_loan_io_out : std_logic_vector(66 downto 0) := (others => '0');
signal hps_0_h2f_loan_io_oe : std_logic_vector(66 downto 0) := (others => '0');
signal dac_spim_sdio : std_logic;
signal dac_spim_oe_n : std_logic;
signal dac_spim_cs_n : std_logic_vector(3 downto 0);
signal dac_sim_sclk : std_logic;
signal dac_data_0 : std_logic_vector(14 downto 0);
signal dac_data_1 : std_logic_vector(14 downto 0);
signal SPI_MISO : std_logic;
signal dac_spim_oe_n_int : std_logic;
signal ni2c_head_en : std_logic_vector(3 downto 0);
signal i2c0_clk : std_logic;
signal i2c0_out_data : std_logic;
signal i2c0_clk_in : std_logic;
signal i2c0_in_data : std_logic;
signal i2c1_clk : std_logic;
signal i2c1_out_data : std_logic;
signal i2c1_clk_in : std_logic;
signal i2c1_in_data : std_logic;
signal debug_output : std_logic_vector(4 downto 0);
------------------------------------------------------------------------------
-- Component declarations
------------------------------------------------------------------------------
component hps_reset is
port(
probe : in std_logic;
source_clk : in std_logic;
source : out std_logic_vector(2 downto 0)
);
end component hps_reset;
component altera_edge_detector is
port(
clk : in std_logic;
rst_n : in std_logic;
signal_in : in std_logic;
pulse_out : out std_logic
);
end component altera_edge_detector;
begin
-- Priority encode the head I2C enables (active low) to avoid contention
ni2c_head_en <= "1110" when lvds_tx_tmp(LVDS_TX_HD0_NI2C_HEAD_EN) = '0' else
"1101" when lvds_tx_tmp(LVDS_TX_HD1_NI2C_HEAD_EN) = '0' else
"1011" when lvds_tx_tmp(LVDS_TX_HD2_NI2C_HEAD_EN) = '0' else
"0111" when lvds_tx_tmp(LVDS_TX_HD3_NI2C_HEAD_EN) = '0' else
"1111";
TX_P_SSE(TX_P_HD0_NI2C_HEAD_EN) <= ni2c_head_en(0); -- HD0 nI2C_HEAD_EN
TX_N_SSE(TX_N_HD1_NI2C_HEAD_EN) <= ni2c_head_en(1); -- HD1 nI2C_HEAD_EN
TX_P_SSE(TX_P_HD2_NI2C_HEAD_EN) <= ni2c_head_en(2); -- HD2 nI2C_HEAD_EN
TX_N_SSE(TX_N_HD3_NI2C_HEAD_EN) <= ni2c_head_en(3); -- HD3 nI2C_HEAD_EN
hps_0_h2f_loan_io_oe(HPS_LOANIO_LED_G) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_LED_Y) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_LED_R) <= '1';
hps_0_h2f_loan_io_out(HPS_LOANIO_LED_G) <= lvds_tx_tmp(LVDS_TX_LED_G);
hps_0_h2f_loan_io_out(HPS_LOANIO_LED_Y) <= lvds_tx_tmp(LVDS_TX_LED_Y);
hps_0_h2f_loan_io_out(HPS_LOANIO_LED_R) <= lvds_tx_tmp(LVDS_TX_LED_R);
--TX_N_SSE(TX_N_HD0_THERM_FAULT) <= 'Z'; -- HD0 THERM_FAULT
--TX_N_SSE(TX_N_HD1_THERM_FAULT) <= 'Z'; -- HD1 THERM_FAULT
--TX_N_SSE(TX_N_HD2_THERM_FAULT) <= 'Z'; -- HD2 THERM_FAULT
--TX_N_SSE(TX_N_HD3_THERM_FAULT) <= 'Z'; -- HD4 THERM_FAULT
TX_N_SSE(TX_N_HV_CLK180_0) <= hv_clk_phase180;
TX_N_SSE(TX_N_HV_CLK180_1) <= hv_clk_phase270;
TX_N_SSE(TX_N_HMB1_STM8_TRIGGER_RX) <= lvds_tx_tmp(LVDS_TX_HMB1_STM8_TRIGGER_RX);
TX_N_SSE(TX_N_HMB1_STM8_ALERT_TX) <= 'Z';
TX_P_SSE(TX_P_HMB_STM8_TRIGGER_RX) <= lvds_tx_tmp(LVDS_TX_HMB_STM8_TRIGGER_RX); -- STM8_TRIGGER_RX
TX_N_SSE(TX_N_HMB_STM8_ALERT_TX) <= 'Z'; -- STM8_ALERT_TX
TX_N_SSE(TX_N_HD0_NSWIM_RST) <= lvds_tx_tmp(LVDS_TX_HD0_NSWIM_RST); -- HD0 SWIM Reset (active low)
TX_N_SSE(TX_N_HD1_NSWIM_RST) <= lvds_tx_tmp(LVDS_TX_HD1_NSWIM_RST); -- HD1 SWIM Reset (active low)
TX_N_SSE(TX_N_HD2_NSWIM_RST) <= lvds_tx_tmp(LVDS_TX_HD2_NSWIM_RST); -- HD2 SWIM Reset (active low)
TX_N_SSE(TX_N_HD3_NSWIM_RST) <= lvds_tx_tmp(LVDS_TX_HD3_NSWIM_RST); -- HD3 SWIM Reset (active low)
TX_P_SSE(TX_P_HEAD_MUX0) <= lvds_tx_tmp(LVDS_TX_HEAD_MUX0); -- HEAD_MUX[0]
TX_N_SSE(TX_N_HEAD_MUX1) <= lvds_tx_tmp(LVDS_TX_HEAD_MUX1); -- HEAD_MUX[1]
TX_P_SSE(TX_P_HV_EN0) <= lvds_tx_tmp(LVDS_TX_HV_EN0); -- HV_EN[0];
TX_P_SSE(TX_P_HV_CLK0) <= hv_clk_phase0; -- HV_CLK[0];
TX_P_SSE(TX_P_HV_EN1) <= lvds_tx_tmp(LVDS_TX_HV_EN1); -- HV_EN[1];
TX_P_SSE(TX_P_HV_CLK1) <= hv_clk_phase90; -- HV_CLK[1];
pio_in(PIO_IN_THERM_FAULTS) <= (others => '0'); -- TX_N_SSE(TX_N_HD3_THERM_FAULT downto TX_N_HD0_THERM_FAULT);
pio_in(PIO_IN_I2C_FAULTS) <= (others => '0'); -- TX_P_SSE(TX_P_HD3_I2C_FAULT downto TX_P_HD0_I2C_FAULT);
pio_in(PIO_IN_UNUSED0) <= (others => '0');
pio_in(PIO_IN_HMB1_STM8_ALERT_TX) <= TX_N_SSE(TX_N_HMB1_STM8_ALERT_TX);
pio_in(PIO_IN_SOM_STM8_ALERT_TX) <= STM8_ALERT_TX;
pio_in(PIO_IN_HMB_STM8_ALERT_TX) <= TX_N_SSE(TX_N_HMB_STM8_ALERT_TX);
pio_in(PIO_IN_P_HOST_GOOD) <= P_HOST_GOOD;
pio_in(PIO_IN_P_IN_GOOD) <= P_IN_GOOD;
pio_in(PIO_IN_P_GOOD) <= P_GOOD;
pio_in(PIO_IN_I2C_SCL_SNIFF) <= i2c1_clk_in & i2c0_clk_in;
pio_in(PIO_IN_UNUSED1) <= '0';
pio_in(PIO_IN_UNUSED2) <= (others => '0');
--LED <= pio_out(PIO_OUT_LED);
--LED <= dac_spim_oe_n_int & dac_spim_cs_n(0) & pio_out(9) & lvds_tx_tmp(LVDS_TX_NC0) & dac_sim_sclk;
--LED <= debug_output;
-- LED <= i2c0_out_data&
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SCL) &
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SDA) &
-- i2c1_out_data &
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SDA);
LED <= debug_output(4) & debug_output(3) & debug_output(2) & debug_output(1) & debug_output(0);
STM8_TRIGGER_RX <= pio_out(PIO_OUT_SOM_STM8_TRIGGER_RX);
HOST_5V_EN <= pio_out(PIO_OUT_HOST_5V_EN);
HOST_3V3_EN <= pio_out(PIO_OUT_HOST_3V3_EN);
HOST_2V5_EN <= pio_out(PIO_OUT_HOST_2V5_EN);
HOST_1V5_EN <= pio_out(PIO_OUT_HOST_1V5_EN);
HOST_1V2_EN <= pio_out(PIO_OUT_HOST_1V2_EN);
HOST_1V1_EN <= pio_out(PIO_OUT_HOST_1V1_EN);
HOST_PWR_EN <= pio_out(PIO_OUT_HOST_PWR_EN);
-- HMB FPGA configuration interface. Set the inputs and the outputs
hps_0_h2f_loan_io_oe(HPS_LOANIO_FPGA_DCLK) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_FPGA_DATA) <= fpga_cfg_oe;
hps_0_h2f_loan_io_oe(HPS_LOANIO_FPGA_CONFIG_DONE) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_FPGA_NCONFIG) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_FPGA_NSTATUS) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_FAN_PWR_EN_3V3) <= '1';
hps_0_h2f_loan_io_out(HPS_LOANIO_FPGA_DCLK) <= fpga_cfg_dclk;
hps_0_h2f_loan_io_out(HPS_LOANIO_FPGA_DATA) <= fpga_cfg_data;
hps_0_h2f_loan_io_out(HPS_LOANIO_FPGA_NCONFIG) <= fpga_cfg_nconfig;
fpga_cfg_done <= hps_0_h2f_loan_io_in(HPS_LOANIO_FPGA_CONFIG_DONE);
fpga_cfg_nstatus <= hps_0_h2f_loan_io_in(HPS_LOANIO_FPGA_NSTATUS);
fpga_cfg_init_done <= '0'; -- hps_0_h2f_loan_io_in(HPS_LOANIO_FAN_PWR_EN_3V3);
hps_0_h2f_loan_io_out(HPS_LOANIO_FAN_PWR_EN_3V3) <= lvds_tx_tmp(LVDS_TX_FAN_PWR_EN_3V3);
hps_0_h2f_loan_io_oe(HPS_LOANIO_HEATER_EN_0) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_HEATER_EN_1) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_HEATER_EN_2) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_HEATER_EN_3) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_FAN_PWM) <= '1';
hps_0_h2f_loan_io_oe(HPS_LOANIO_FAN_SENSE) <= '0';
hps_0_h2f_loan_io_out(HPS_LOANIO_HEATER_EN_0) <= heater_en(0);
hps_0_h2f_loan_io_out(HPS_LOANIO_HEATER_EN_1) <= heater_en(1);
hps_0_h2f_loan_io_out(HPS_LOANIO_HEATER_EN_2) <= heater_en(2);
hps_0_h2f_loan_io_out(HPS_LOANIO_HEATER_EN_3) <= heater_en(3);
hps_0_h2f_loan_io_out(HPS_LOANIO_FAN_PWM) <= fan_pwm;
fan_sense <= hps_0_h2f_loan_io_out(HPS_LOANIO_FAN_SENSE);
-- SWIM interface connections
swim_rx(0) <= SWIM;
swim_rx(1) <= TX_P_SSE(TX_P_HD0_SWIM);
swim_rx(2) <= TX_P_SSE(TX_P_HD1_SWIM);
swim_rx(3) <= TX_P_SSE(TX_P_HD2_SWIM);
swim_rx(4) <= TX_P_SSE(TX_P_HD3_SWIM);
SWIM <= 'Z' when swim_tx(0) = '1' else '0';
TX_P_SSE(TX_P_HD0_SWIM) <= 'Z' when swim_tx(1) = '1' else '0';
TX_P_SSE(TX_P_HD1_SWIM) <= 'Z' when swim_tx(2) = '1' else '0';
TX_P_SSE(TX_P_HD2_SWIM) <= 'Z' when swim_tx(3) = '1' else '0';
TX_P_SSE(TX_P_HD3_SWIM) <= 'Z' when swim_tx(4) = '1' else '0';
-- AMP/LIMIT control
RX_P(RX_P_AMP_EN) <= pio_out(PIO_OUT_AMP_EN); -- HDx AMP_EN
RX_N(RX_N_HD_PWR_EN) <= pio_out(PIO_OUT_HD_PWR_EN); -- HDx HD_PWR_EN
RX_P(RX_P_I_LIM_MAIN) <= (others => 'Z');
RX_N(RX_N_I_LIM_BIAS) <= (others => 'Z');
pio_in(PIO_IN_I_LIM_MAIN) <= (others => '0'); -- RX_P(RX_P_I_LIM_MAIN);
pio_in(PIO_IN_I_LIM_BIAS) <= (others => '0'); -- RX_N(RX_N_I_LIM_BIAS);
-- DAC0/1 DATA path
RX_P(RX_P_DAC0_DB0) <= dac_data_0(DAC_DATA_DB0);
RX_N(RX_N_DAC0_DB1) <= dac_data_0(DAC_DATA_DB1);
RX_P(RX_P_DAC0_DB2) <= dac_data_0(DAC_DATA_DB2);
RX_N(RX_N_DAC0_DB3) <= dac_data_0(DAC_DATA_DB3);
RX_P(RX_P_DAC0_DB4) <= dac_data_0(DAC_DATA_DB4);
RX_N(RX_N_DAC0_DB5) <= dac_data_0(DAC_DATA_DB5);
RX_P(RX_P_DAC0_DB6) <= dac_data_0(DAC_DATA_DB6);
RX_N(RX_N_DAC0_DB7) <= dac_data_0(DAC_DATA_DB7);
RX_P(RX_P_DAC0_DB8) <= dac_data_0(DAC_DATA_DB8);
RX_N(RX_N_DAC0_DB9) <= dac_data_0(DAC_DATA_DB9);
RX_P(RX_P_DAC0_DB10) <= dac_data_0(DAC_DATA_DB10);
RX_N(RX_N_DAC0_DB11) <= dac_data_0(DAC_DATA_DB11);
RX_P(RX_P_DAC0_DB12) <= dac_data_0(DAC_DATA_DB12);
RX_N(RX_N_DAC0_DB13) <= dac_data_0(DAC_DATA_DB13);
RX_P(RX_P_DAC0_DCLKIO) <= dac_data_0(DAC_DATA_CLK); -- DCLKIO
RX_N(RX_N_DAC0_CLKIN) <= dac_data_0(DAC_DATA_CLK); -- CLKIN
RX_P(RX_P_DAC1_DB0) <= dac_data_1(DAC_DATA_DB0);
RX_N(RX_N_DAC1_DB1) <= dac_data_1(DAC_DATA_DB1);
RX_P(RX_P_DAC1_DB2) <= dac_data_1(DAC_DATA_DB2);
RX_N(RX_N_DAC1_DB3) <= dac_data_1(DAC_DATA_DB3);
RX_P(RX_P_DAC1_DB4) <= dac_data_1(DAC_DATA_DB4);
RX_N(RX_N_DAC1_DB5) <= dac_data_1(DAC_DATA_DB5);
RX_P(RX_P_DAC1_DB6) <= dac_data_1(DAC_DATA_DB6);
RX_N(RX_N_DAC1_DB7) <= dac_data_1(DAC_DATA_DB7);
RX_P(RX_P_DAC1_DB8) <= dac_data_1(DAC_DATA_DB8);
RX_N(RX_N_DAC1_DB9) <= dac_data_1(DAC_DATA_DB9);
RX_P(RX_P_DAC1_DB10) <= dac_data_1(DAC_DATA_DB10);
RX_N(RX_N_DAC1_DB11) <= dac_data_1(DAC_DATA_DB11);
RX_P(RX_P_DAC1_DB12) <= dac_data_1(DAC_DATA_DB12);
RX_N(RX_N_DAC1_DB13) <= dac_data_1(DAC_DATA_DB13);
RX_P(RX_P_DAC1_DCLKIO) <= dac_data_1(DAC_DATA_CLK); -- DCLKIO
RX_N(RX_N_DAC1_CLKIN) <= dac_data_1(DAC_DATA_CLK); -- CLKIN
-- DAC0/1 SPI interface
dac_spim_oe_n_int <= dac_spim_oe_n or lvds_tx_tmp(SPI_OE_MASK); -- See Jira HMBXR5601-93 for original issue on P4
RX_P(RX_P_DAC0_SPIM_CS_N) <= dac_spim_cs_n(0);
RX_N(RX_N_DAC0_RESET) <= pio_out(PIO_OUT_DAC0_RESET); -- TBD: RESET okay from PIO?
RX_P(RX_P_DAC0_SPIM_SCLK) <= dac_sim_sclk;
RX_N(RX_N_DAC0_SPIM_SDIO) <= 'Z' when dac_spim_oe_n_int = '1' else dac_spim_sdio;
RX_P(RX_P_DAC1_SPIM_CS_N) <= dac_spim_cs_n(1);
RX_N(RX_N_DAC1_RESET) <= pio_out(PIO_OUT_DAC1_RESET); -- TBD: RESET okay from PIO?
RX_P(RX_P_DAC1_SPIM_SCLK) <= dac_sim_sclk;
RX_N(RX_N_DAC1_SPIM_SDIO) <= 'Z' when dac_spim_oe_n_int = '1' else dac_spim_sdio;
SPI_MISO <= not dac_spim_oe_n_int or ((RX_N(RX_N_DAC0_SPIM_SDIO) and not dac_spim_cs_n(0)) or
(RX_N(RX_N_DAC1_SPIM_SDIO) and not dac_spim_cs_n(1)));
i2c0_clk_in <= hps_0_h2f_loan_io_in(HPS_LOANIO_SOM_SCL);
i2c0_in_data <= hps_0_h2f_loan_io_in(HPS_LOANIO_SOM_SDA);
i2c1_clk_in <= hps_0_h2f_loan_io_in(HPS_LOANIO_APP_SCL);
i2c1_in_data <= hps_0_h2f_loan_io_in(HPS_LOANIO_APP_SDA);
hps_0_h2f_loan_io_out(HPS_LOANIO_SOM_SDA) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SDA) <= i2c0_out_data or lvds_tx_tmp(LVDS_TX_SOM_SDA_MASK);
hps_0_h2f_loan_io_out(HPS_LOANIO_SOM_SCL) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SCL) <= i2c0_clk or lvds_tx_tmp(LVDS_TX_SOM_SCL_MASK);
hps_0_h2f_loan_io_out(HPS_LOANIO_APP_SDA) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SDA) <= i2c1_out_data or lvds_tx_tmp(LVDS_TX_APP_SDA_MASK);
hps_0_h2f_loan_io_out(HPS_LOANIO_APP_SCL) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SCL) <= i2c1_clk or lvds_tx_tmp(LVDS_TX_APP_SCL_MASK);
-- QSYS top level block instantiation
top_system_1 : entity top_system.top_system
port map(
clk_clk => FPGA_CLK_25,
hps_0_f2h_cold_reset_req_reset_n => hps_cold_reset_n,
hps_0_f2h_debug_reset_req_reset_n => hps_debug_reset_n,
hps_0_f2h_warm_reset_req_reset_n => hps_warm_reset_n,
hps_0_h2f_reset_reset_n => hps_reset_n,
hps_0_h2f_loan_io_in => hps_0_h2f_loan_io_in,
hps_0_h2f_loan_io_out => hps_0_h2f_loan_io_out,
hps_0_h2f_loan_io_oe => hps_0_h2f_loan_io_oe,
hps_0_hps_io_hps_io_emac0_inst_TX_CLK => hps_emac0_TX_CLK,
hps_0_hps_io_hps_io_emac0_inst_TXD0 => hps_emac0_TXD0,
hps_0_hps_io_hps_io_emac0_inst_TXD1 => hps_emac0_TXD1,
hps_0_hps_io_hps_io_emac0_inst_TXD2 => hps_emac0_TXD2,
hps_0_hps_io_hps_io_emac0_inst_TXD3 => hps_emac0_TXD3,
hps_0_hps_io_hps_io_emac0_inst_RXD0 => hps_emac0_RXD0,
hps_0_hps_io_hps_io_emac0_inst_MDIO => hps_emac0_MDIO,
hps_0_hps_io_hps_io_emac0_inst_MDC => hps_emac0_MDC,
hps_0_hps_io_hps_io_emac0_inst_RX_CTL => hps_emac0_RX_CTL,
hps_0_hps_io_hps_io_emac0_inst_TX_CTL => hps_emac0_TX_CTL,
hps_0_hps_io_hps_io_emac0_inst_RX_CLK => hps_emac0_RX_CLK,
hps_0_hps_io_hps_io_emac0_inst_RXD1 => hps_emac0_RXD1,
hps_0_hps_io_hps_io_emac0_inst_RXD2 => hps_emac0_RXD2,
hps_0_hps_io_hps_io_emac0_inst_RXD3 => hps_emac0_RXD3,
hps_0_hps_io_hps_io_emac1_inst_TX_CLK => hps_emac1_TX_CLK,
hps_0_hps_io_hps_io_emac1_inst_TXD0 => hps_emac1_TXD0,
hps_0_hps_io_hps_io_emac1_inst_TXD1 => hps_emac1_TXD1,
hps_0_hps_io_hps_io_emac1_inst_TXD2 => hps_emac1_TXD2,
hps_0_hps_io_hps_io_emac1_inst_TXD3 => hps_emac1_TXD3,
hps_0_hps_io_hps_io_emac1_inst_RXD0 => hps_emac1_RXD0,
hps_0_hps_io_hps_io_emac1_inst_MDIO => hps_emac1_MDIO,
hps_0_hps_io_hps_io_emac1_inst_MDC => hps_emac1_MDC,
hps_0_hps_io_hps_io_emac1_inst_RX_CTL => hps_emac1_RX_CTL,
hps_0_hps_io_hps_io_emac1_inst_TX_CTL => hps_emac1_TX_CTL,
hps_0_hps_io_hps_io_emac1_inst_RX_CLK => hps_emac1_RX_CLK,
hps_0_hps_io_hps_io_emac1_inst_RXD1 => hps_emac1_RXD1,
hps_0_hps_io_hps_io_emac1_inst_RXD2 => hps_emac1_RXD2,
hps_0_hps_io_hps_io_emac1_inst_RXD3 => hps_emac1_RXD3,
hps_0_hps_io_hps_io_sdio_inst_CMD => hps_sdio_CMD,
hps_0_hps_io_hps_io_sdio_inst_D0 => hps_sdio_D0,
hps_0_hps_io_hps_io_sdio_inst_D1 => hps_sdio_D1,
hps_0_hps_io_hps_io_sdio_inst_CLK => hps_sdio_CLK,
hps_0_hps_io_hps_io_sdio_inst_D2 => hps_sdio_D2,
hps_0_hps_io_hps_io_sdio_inst_D3 => hps_sdio_D3,
hps_0_hps_io_hps_io_sdio_inst_D4 => hps_sdio_D4,
hps_0_hps_io_hps_io_sdio_inst_D5 => hps_sdio_D5,
hps_0_hps_io_hps_io_sdio_inst_D6 => hps_sdio_D6,
hps_0_hps_io_hps_io_sdio_inst_D7 => hps_sdio_D7,
--hps_0_hps_io_hps_io_i2c1_inst_SDA => SDA_APP,
--hps_0_hps_io_hps_io_i2c1_inst_SCL => SCL_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO28 => hps_GPIO(HPS_GPIO_BSEL2_GPIO_3V3_0), -- HPS_BSEL2/GPIO_3V3_0
hps_0_hps_io_hps_io_gpio_inst_LOANIO29 => hps_GPIO(HPS_GPIO_GPIO_3V3_1), -- GPIO_3V3_1
hps_0_hps_io_hps_io_gpio_inst_LOANIO30 => hps_GPIO(HPS_GPIO_GPIO_3V3_2), -- GPIO_3V3_2
hps_0_hps_io_hps_io_gpio_inst_GPIO31 => hps_GPIO(HPS_GPIO_GBE0_NRESET), -- GbE0_nRESET
hps_0_hps_io_hps_io_gpio_inst_GPIO32 => hps_GPIO(HPS_GPIO_GBE0_PHY_NINT), -- GbE0_PHY_nINT (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO33 => hps_GPIO(HPS_GPIO_BSEL1_GPIO_3V3_3), -- HPS_BSEL1/GPIO_3V3_3
hps_0_hps_io_hps_io_gpio_inst_GPIO34 => hps_GPIO(HPS_GPIO_GBE1_NRESET), -- GbE1_nRESET
hps_0_hps_io_hps_io_gpio_inst_GPIO35 => hps_GPIO(HPS_GPIO_GBE1_PHY_NINT), -- GbE1_PHY_nINT
hps_0_hps_io_hps_io_gpio_inst_LOANIO37 => hps_GPIO(HPS_GPIO_GPIO_3V3_4), -- GPIO_3V3_4
hps_0_hps_io_hps_io_gpio_inst_GPIO44 => hps_GPIO(HPS_GPIO_GPIO_3V3_5), -- GPIO_3V3_5
hps_0_hps_io_hps_io_gpio_inst_GPIO48 => hps_GPIO(HPS_GPIO_SD_PRESENT), -- SD_PRESENT (input)
hps_0_hps_io_hps_io_gpio_inst_GPIO49 => hps_GPIO(HPS_GPIO_GPIO_3V3_6), -- GPIO_3V3_6
hps_0_hps_io_hps_io_gpio_inst_LOANIO50 => hps_GPIO(HPS_GPIO_LED_G), -- nHPS_LED_G
hps_0_hps_io_hps_io_gpio_inst_LOANIO53 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_INIT_DONE), -- HMB FPGA INIT_DONE/CAN_RX (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO54 => hps_GPIO(HPS_GPIO_CAN_TX), -- CAN_TX
hps_0_hps_io_hps_io_gpio_inst_LOANIO55 => hps_GPIO(HPS_GPIO_LED_Y), -- nHPS_LED_Y
hps_0_hps_io_hps_io_gpio_inst_LOANIO56 => hps_GPIO(HPS_GPIO_LED_R), -- nHPS_LED_R
hps_0_hps_io_hps_io_gpio_inst_LOANIO57 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_DCLK), -- HMB FPGA DCLK
hps_0_hps_io_hps_io_gpio_inst_LOANIO58 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_DATA), -- HMB FPGA DATA
hps_0_hps_io_hps_io_gpio_inst_LOANIO59 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_CONFIG_DONE), -- HMB FPGA CONFIG_DONE
hps_0_hps_io_hps_io_gpio_inst_LOANIO60 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_NCONFIG), -- HMB FPGA NCONFIG
hps_0_hps_io_hps_io_gpio_inst_LOANIO61 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_NSTATUS), -- HMB FPGA NSTATUS (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO63 => SDA_SOM,
hps_0_hps_io_hps_io_gpio_inst_LOANIO64 => SCL_SOM,
hps_0_hps_io_hps_io_gpio_inst_LOANIO51 => SDA_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO52 => SCL_APP,
hps_0_hps_io_hps_io_gpio_inst_GPIO62 => hps_GPIO(HPS_GPIO_FORCE_EEMC_CLKSEL1), -- FORCE_EMMC/CLKSEL1
hps_0_hps_io_hps_io_uart0_inst_RX => hps_GPIO(HPS_GPIO_HPS_RX), -- HPS_RX
hps_0_hps_io_hps_io_uart0_inst_TX => hps_GPIO(HPS_GPIO_HPS_TX), -- HPS_TX
hps_0_spim0_rxd => SPI_MISO,
hps_0_spim0_ss_in_n => '1', -- Motorola SPI frame format (0 = TI SSP).
hps_0_spim0_ssi_oe_n => dac_spim_oe_n,
hps_0_spim0_ss_0_n => dac_spim_cs_n(0),
hps_0_spim0_ss_1_n => dac_spim_cs_n(1),
hps_0_spim0_ss_2_n => dac_spim_cs_n(2),
hps_0_spim0_ss_3_n => dac_spim_cs_n(3),
hps_0_spim0_txd => dac_spim_sdio,
hps_0_spim0_sclk_out_clk => dac_sim_sclk,
hps_0_i2c0_out_data => i2c0_out_data,
hps_0_i2c0_sda => i2c0_in_data,
hps_0_i2c0_clk_clk => i2c0_clk,
hps_0_i2c0_scl_in_clk => i2c0_clk_in,
hps_0_i2c1_out_data => i2c1_out_data,
hps_0_i2c1_sda => i2c1_in_data,
hps_0_i2c1_clk_clk => i2c1_clk,
hps_0_i2c1_scl_in_clk => i2c1_clk_in,
timing_tx_n => TIMING_TX_N,
timing_rx_p => TIMING_RX_P,
timing_tx_p => TIMING_TX_P,
timing_rx_n => TIMING_RX_N,
lvds_tx_ser => TX_P(TX_P_LVDS_SER),
lvds_tx_pio => lvds_tx_tmp,
memory_mem_a => memory_mem_a,
memory_mem_ba => memory_mem_ba,
memory_mem_ck => memory_mem_ck,
memory_mem_ck_n => memory_mem_ck_n,
memory_mem_cke => memory_mem_cke,
memory_mem_cs_n => memory_mem_cs_n,
memory_mem_ras_n => memory_mem_ras_n,
memory_mem_cas_n => memory_mem_cas_n,
memory_mem_we_n => memory_mem_we_n,
memory_mem_reset_n => memory_mem_reset_n,
memory_mem_dq => memory_mem_dq,
memory_mem_dqs => memory_mem_dqs,
memory_mem_dqs_n => memory_mem_dqs_n,
memory_mem_odt => memory_mem_odt,
memory_mem_dm => memory_mem_dm,
memory_oct_rzqin => memory_oct_rzqin,
pio_pio_in => pio_in,
pio_pio_out => pio_out,
pio_pio_out_en => open,
reset_reset_n => hps_reset_n,
swim_rx => swim_rx,
swim_tx => swim_tx,
fpga_cfg_dclk => fpga_cfg_dclk,
fpga_cfg_data => fpga_cfg_data,
fpga_cfg_done => fpga_cfg_done,
fpga_cfg_nstatus => fpga_cfg_nstatus,
fpga_cfg_nconfig => fpga_cfg_nconfig,
fpga_cfg_init_done => fpga_cfg_init_done,
fpga_cfg_oe => fpga_cfg_oe,
pwm_out_fan => fan_pwm,
pwm_out_heat => heater_en,
pwm_fan_sense => fan_sense,
hv_clk_phase0 => hv_clk_phase0,
hv_clk_phase90 => hv_clk_phase90,
hv_clk_phase180 => hv_clk_phase180,
hv_clk_phase270 => hv_clk_phase270,
dac_data_0 => dac_data_0,
dac_data_1 => dac_data_1,
debug_output => debug_output
);
-- Tie off signals for HV that are unused.
--memory_mem_a(15) <= '0';
--memory_mem_cke(1) <= '0';
--memory_mem_cs_n(1) <= '0';
--memory_mem_odt(1) <= '0';
hps_cold_reset_n <= not hps_cold_reset;
hps_warm_reset_n <= not hps_warm_reset;
hps_debug_reset_n <= not hps_debug_reset;
-- Source/Probe megawizard instance
hps_reset_inst : hps_reset
port map(
probe => '0',
source_clk => FPGA_CLK_25,
source => hps_reset_req
);
pulse_cold_reset : altera_edge_detector
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(0),
pulse_out => hps_cold_reset
);
--defparam pulse_cold_reset.PULSE_EXT = 6;
--defparam pulse_cold_reset.EDGE_TYPE = 1;
--defparam pulse_cold_reset.IGNORE_RST_WHILE_BUSY = 1;
pulse_warm_reset : altera_edge_detector
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(1),
pulse_out => hps_warm_reset
);
--defparam pulse_warm_reset.PULSE_EXT = 2;
--defparam pulse_warm_reset.EDGE_TYPE = 1;
--defparam pulse_warm_reset.IGNORE_RST_WHILE_BUSY = 1;
pulse_debug_reset : altera_edge_detector
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(2),
pulse_out => hps_debug_reset
);
--defparam pulse_debug_reset.PULSE_EXT = 32;
--defparam pulse_debug_reset.EDGE_TYPE = 1;
--defparam pulse_debug_reset.IGNORE_RST_WHILE_BUSY = 1;
end;

View file

@ -0,0 +1,278 @@
-------------------------------------------------------------------------------
-- Title : SOM FPGA top level package
-- Project : GMA
-------------------------------------------------------------------------------
-- File : top.vhd
-- Author : Simon Southwell
-- Company : Global Inkjet Systems
-- Created : 2018-01-22
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block is the package top level for the SOM board FPGA on the GMA
-- product. It defines all the bit mappings between core logic signalling
-- and the input/output ports as mapped on the SoM *and* those routed to
-- the GMA's HMB via the RX and TX signals.
-------------------------------------------------------------------------------
-- Copyright (c) 2018 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
package top_pkg is
constant LVDS_RX_TIMING_RX_P : integer := 0;
constant UNUSED_LVDS_TX_TIMING_TX_P : integer := 15;
constant LVDS_TX_HD0_NI2C_HEAD_EN : integer := 0;
constant LVDS_TX_HD1_NI2C_HEAD_EN : integer := 1;
constant LVDS_TX_HD2_NI2C_HEAD_EN : integer := 2;
constant LVDS_TX_HD3_NI2C_HEAD_EN : integer := 3;
constant TX_P_HD0_NI2C_HEAD_EN : integer := 17;
constant TX_N_HD1_NI2C_HEAD_EN : integer := 17;
constant TX_P_HD2_NI2C_HEAD_EN : integer := 18;
constant TX_N_HD3_NI2C_HEAD_EN : integer := 18;
constant TX_P_HV_EN0 : integer := 19;
constant TX_P_HV_CLK0 : integer := 20;
constant TX_P_HV_EN1 : integer := 21;
constant TX_P_HV_CLK1 : integer := 22;
--constant TX_N_HD0_THERM_FAULT : integer := 19;
--constant TX_N_HD1_THERM_FAULT : integer := 20;
--constant TX_N_HD2_THERM_FAULT : integer := 21;
--constant TX_N_HD3_THERM_FAULT : integer := 22;
constant TX_N_HV_CLK180_0 : integer := 19;
constant TX_N_HV_CLK180_1 : integer := 20;
constant TX_N_HMB1_STM8_TRIGGER_RX : integer := 21;
constant TX_N_HMB1_STM8_ALERT_TX : integer := 22;
constant LVDS_TX_HMB_STM8_TRIGGER_RX : integer := 4;
constant LVDS_TX_HMB1_STM8_TRIGGER_RX : integer := 26;
constant LVDS_TX_FAN_PWR_EN_3V3 : integer := 27;
constant TX_P_HMB_STM8_TRIGGER_RX : integer := 23;
constant TX_N_HMB_STM8_ALERT_TX : integer := 23;
-- constant UNUSED_LVDS_HD0_TX_LED_R : integer := 5;
-- constant UNUSED_LVDS_HD1_TX_LED_R : integer := 7;
-- constant UNUSED_LVDS_HD2_TX_LED_R : integer := 9;
constant UNUSED_LVDS_HD3_TX_LED_R : integer := 11;
constant LVDS_TX_LED_G : integer := 5; -- index of lvds_tx_tmp
constant LVDS_TX_LED_Y : integer := 7;
constant LVDS_TX_LED_R : integer := 9;
constant LVDS_TX_HD0_NSWIM_RST : integer := 6;
constant LVDS_TX_HD1_NSWIM_RST : integer := 8;
constant LVDS_TX_HD2_NSWIM_RST : integer := 10;
constant LVDS_TX_HD3_NSWIM_RST : integer := 12;
constant TX_P_HD0_SWIM : integer := 24;
constant TX_P_HD1_SWIM : integer := 25;
constant TX_P_HD2_SWIM : integer := 26;
constant TX_P_HD3_SWIM : integer := 27;
constant TX_N_HD0_NSWIM_RST : integer := 24;
constant TX_N_HD1_NSWIM_RST : integer := 25;
constant TX_N_HD2_NSWIM_RST : integer := 26;
constant TX_N_HD3_NSWIM_RST : integer := 27;
constant SPI_OE_MASK : integer := 13;
constant UNUSED_LVDS_TX_SEL_CPU_TIMING_TX : integer := 14;
constant LVDS_TX_HEAD_MUX0 : integer := 20;
constant LVDS_TX_HEAD_MUX1 : integer := 21;
constant LVDS_TX_HV_EN0 : integer := 22;
constant LVDS_TX_HV_EN1 : integer := 23;
constant LVDS_TX_SOM_SDA_MASK : integer := 24;
constant LVDS_TX_APP_SDA_MASK : integer := 25;
constant LVDS_TX_SOM_SCL_MASK : integer := 28;
constant LVDS_TX_APP_SCL_MASK : integer := 29;
constant TX_P_HEAD_MUX0 : integer := 28;
constant TX_N_HEAD_MUX1 : integer := 28;
subtype PIO_IN_THERM_FAULTS is natural range 3 downto 0;
subtype PIO_IN_I2C_FAULTS is natural range 7 downto 4;
subtype PIO_IN_UNUSED0 is natural range 12 downto 8;
constant PIO_IN_HMB1_STM8_ALERT_TX : integer := 13;
constant PIO_IN_SOM_STM8_ALERT_TX : integer := 14;
constant PIO_IN_HMB_STM8_ALERT_TX : integer := 15;
constant PIO_IN_P_HOST_GOOD : integer := 16;
constant PIO_IN_P_IN_GOOD : integer := 17;
constant PIO_IN_P_GOOD : integer := 18;
constant PIO_IN_UNUSED1 : integer := 19;
subtype PIO_IN_I_LIM_MAIN is natural range 23 downto 20;
subtype PIO_IN_I_LIM_BIAS is natural range 27 downto 24;
subtype PIO_IN_I2C_SCL_SNIFF is natural range 29 downto 28;
subtype PIO_IN_UNUSED2 is natural range 31 downto 30;
constant TX_N_SOM_STM8_TRIGGER_RX : integer := 23;
constant PIO_OUT_HOST_PWR_EN : integer := 0;
constant PIO_OUT_HOST_1V1_EN : integer := 1;
constant PIO_OUT_HOST_1V2_EN : integer := 2;
constant PIO_OUT_HOST_1V5_EN : integer := 3;
constant PIO_OUT_HOST_2V5_EN : integer := 4;
constant PIO_OUT_HOST_3V3_EN : integer := 5;
constant PIO_OUT_HOST_5V_EN : integer := 6;
constant PIO_OUT_SOM_STM8_TRIGGER_RX : integer := 7;
constant PIO_OUT_SEL_STM8_TRIG_CPU_CTRL : integer := 8;
constant SIG_SEQ_CTRL_PWR_EN : integer := 0;
constant SIG_SEQ_CTRL_1V1_EN : integer := 1;
constant SIG_SEQ_CTRL_1V2_EN : integer := 2;
constant SIG_SEQ_CTRL_1V5_EN : integer := 3;
constant SIG_SEQ_CTRL_2V5_EN : integer := 4;
constant SIG_SEQ_CTRL_3V3_EN : integer := 5;
constant SIG_SEQ_CTRL_5V_EN : integer := 6;
constant SIG_SEQ_CTRL_AMP_EN_0 : integer := 7;
constant SIG_SEQ_CTRL_AMP_EN_1 : integer := 8;
constant SIG_SEQ_CTRL_AMP_EN_2 : integer := 9;
constant SIG_SEQ_CTRL_AMP_EN_3 : integer := 10;
constant SIG_SEQ_CTRL_HD_PWR_EN_0 : integer := 11;
constant SIG_SEQ_CTRL_HD_PWR_EN_1 : integer := 12;
constant SIG_SEQ_CTRL_HD_PWR_EN_2 : integer := 13;
constant SIG_SEQ_CTRL_HD_PWR_EN_3 : integer := 14;
constant SIG_SEQ_CTRL_DISABLE_FIRE_REQS : integer := 15;
constant SIG_SEQ_CTRL_FORCE_DACS_0V : integer := 16;
constant SIG_SEQ_CTRL_HV_0 : integer := 17;
constant SIG_SEQ_CTRL_HV_1 : integer := 18;
constant SIG_SEQ_CTRL_WIDTH : integer := 19;
subtype PIO_OUT_LED is natural range 13 downto 9;
constant PIO_OUT_DAC0_RESET : integer := 14;
constant PIO_OUT_DAC1_RESET : integer := 15;
-- indices of hps_0_h2f_loan_io* bus corresponding to the GPIO# to be driven
constant HPS_LOANIO_FAN_PWR_EN_3V3 : integer := 53;
constant HPS_LOANIO_FPGA_DCLK : integer := 57;
constant HPS_LOANIO_FPGA_DATA : integer := 58;
constant HPS_LOANIO_FPGA_CONFIG_DONE : integer := 59;
constant HPS_LOANIO_FPGA_NCONFIG : integer := 60;
constant HPS_LOANIO_FPGA_NSTATUS : integer := 61;
constant HPS_LOANIO_HEATER_EN_0 : integer := 28;
constant HPS_LOANIO_HEATER_EN_1 : integer := 29;
constant HPS_LOANIO_HEATER_EN_2 : integer := 30;
constant HPS_LOANIO_HEATER_EN_3 : integer := 33;
constant HPS_LOANIO_FAN_PWM : integer := 37;
constant HPS_LOANIO_FAN_SENSE : integer := 54;
constant HPS_LOANIO_APP_SDA : integer := 51;
constant HPS_LOANIO_APP_SCL : integer := 52;
constant HPS_LOANIO_SOM_SDA : integer := 63;
constant HPS_LOANIO_SOM_SCL : integer := 64;
constant HPS_LOANIO_LED_G : integer := 50;
constant HPS_LOANIO_LED_Y : integer := 55;
constant HPS_LOANIO_LED_R : integer := 56;
constant PIO_OUT_HD0_PWR_EN : integer := 24;
constant PIO_OUT_HD1_PWR_EN : integer := 25;
constant PIO_OUT_HD2_PWR_EN : integer := 26;
constant PIO_OUT_HD3_PWR_EN : integer := 27;
subtype RX_P_AMP_EN is natural range 3 downto 0;
subtype RX_P_I_LIM_MAIN is natural range 7 downto 4;
subtype RX_N_HD_PWR_EN is natural range 3 downto 0;
subtype RX_N_I_LIM_BIAS is natural range 7 downto 4;
subtype PIO_OUT_AMP_EN is natural range 19 downto 16;
subtype PIO_OUT_HD_PWR_EN is natural range PIO_OUT_HD3_PWR_EN downto PIO_OUT_HD0_PWR_EN;
constant RX_P_HD0_NV_AMP_N_PLL : integer := 26;
constant RX_N_HD1_NV_AMP_N_PLL : integer := 26;
constant RX_P_HD2_NV_AMP_N_PLL : integer := 27;
constant RX_N_HD3_NV_AMP_N_PLL : integer := 27;
constant LVDS_TX_HD0_NV_AMP_N_PLL : integer := 16;
constant LVDS_TX_HD1_NV_AMP_N_PLL : integer := 17;
constant LVDS_TX_HD2_NV_AMP_N_PLL : integer := 18;
constant LVDS_TX_HD3_NV_AMP_N_PLL : integer := 19;
constant RX_P_DAC0_DB0 : integer := 27;
constant RX_N_DAC0_DB1 : integer := 27;
constant RX_P_DAC0_DB2 : integer := 8;
constant RX_N_DAC0_DB3 : integer := 8;
constant RX_P_DAC0_DB4 : integer := 9;
constant RX_N_DAC0_DB5 : integer := 9;
constant RX_P_DAC0_DB6 : integer := 10;
constant RX_N_DAC0_DB7 : integer := 10;
constant RX_P_DAC0_DB8 : integer := 11;
constant RX_N_DAC0_DB9 : integer := 11;
constant RX_P_DAC0_DB10 : integer := 12;
constant RX_N_DAC0_DB11 : integer := 12;
constant RX_P_DAC0_DB12 : integer := 13;
constant RX_N_DAC0_DB13 : integer := 13;
constant RX_P_DAC0_DCLKIO : integer := 14;
constant RX_N_DAC0_CLKIN : integer := 14;
constant RX_P_DAC1_DB0 : integer := 26;
constant RX_N_DAC1_DB1 : integer := 26;
constant RX_P_DAC1_DB2 : integer := 17;
constant RX_N_DAC1_DB3 : integer := 17;
constant RX_P_DAC1_DB4 : integer := 18;
constant RX_N_DAC1_DB5 : integer := 18;
constant RX_P_DAC1_DB6 : integer := 19;
constant RX_N_DAC1_DB7 : integer := 19;
constant RX_P_DAC1_DB8 : integer := 20;
constant RX_N_DAC1_DB9 : integer := 20;
constant RX_P_DAC1_DB10 : integer := 21;
constant RX_N_DAC1_DB11 : integer := 21;
constant RX_P_DAC1_DB12 : integer := 22;
constant RX_N_DAC1_DB13 : integer := 22;
constant RX_P_DAC1_DCLKIO : integer := 23;
constant RX_N_DAC1_CLKIN : integer := 23;
constant DAC_DATA_DB0 : integer := 0;
constant DAC_DATA_DB1 : integer := 1;
constant DAC_DATA_DB2 : integer := 2;
constant DAC_DATA_DB3 : integer := 3;
constant DAC_DATA_DB4 : integer := 4;
constant DAC_DATA_DB5 : integer := 5;
constant DAC_DATA_DB6 : integer := 6;
constant DAC_DATA_DB7 : integer := 7;
constant DAC_DATA_DB8 : integer := 8;
constant DAC_DATA_DB9 : integer := 9;
constant DAC_DATA_DB10 : integer := 10;
constant DAC_DATA_DB11 : integer := 11;
constant DAC_DATA_DB12 : integer := 12;
constant DAC_DATA_DB13 : integer := 13;
constant DAC_DATA_CLK : integer := 14;
constant RX_P_DAC0_SPIM_CS_N : integer := 15;
constant RX_N_DAC0_RESET : integer := 15;
constant RX_P_DAC0_SPIM_SCLK : integer := 16;
constant RX_N_DAC0_SPIM_SDIO : integer := 16;
constant RX_P_DAC1_SPIM_CS_N : integer := 24;
constant RX_N_DAC1_RESET : integer := 24;
constant RX_P_DAC1_SPIM_SCLK : integer := 25;
constant RX_N_DAC1_SPIM_SDIO : integer := 25;
subtype TX_P_LVDS_SER is natural range 16 downto 0;
-- index of top.vhd hps_GPIO port which is mapped back to correct pins in top.qsf
constant HPS_GPIO_BSEL2_GPIO_3V3_0 : integer := 0;
constant HPS_GPIO_GPIO_3V3_1 : integer := 1;
constant HPS_GPIO_GPIO_3V3_2 : integer := 2;
constant HPS_GPIO_GBE0_NRESET : integer := 3;
constant HPS_GPIO_GBE0_PHY_NINT : integer := 4;
constant HPS_GPIO_BSEL1_GPIO_3V3_3 : integer := 5;
constant HPS_GPIO_GBE1_NRESET : integer := 6;
constant HPS_GPIO_GBE1_PHY_NINT : integer := 7;
constant HPS_GPIO_GPIO_3V3_4 : integer := 8;
constant HPS_GPIO_GPIO_3V3_5 : integer := 9;
constant HPS_GPIO_SD_PRESENT : integer := 10;
constant HPS_GPIO_GPIO_3V3_6 : integer := 11;
constant HPS_GPIO_LED_G : integer := 12;
constant HPS_GPIO_LOANIO_FPGA_INIT_DONE : integer := 13;
constant HPS_GPIO_CAN_TX : integer := 14;
constant HPS_GPIO_LED_Y : integer := 15;
constant HPS_GPIO_LED_R : integer := 16;
constant HPS_GPIO_LOANIO_FPGA_DCLK : integer := 17;
constant HPS_GPIO_LOANIO_FPGA_DATA : integer := 18;
constant HPS_GPIO_LOANIO_FPGA_CONFIG_DONE : integer := 19;
constant HPS_GPIO_LOANIO_FPGA_NCONFIG : integer := 20;
constant HPS_GPIO_LOANIO_FPGA_NSTATUS : integer := 21;
constant HPS_GPIO_FORCE_EEMC_CLKSEL1 : integer := 22;
constant HPS_GPIO_HPS_RX : integer := 23;
constant HPS_GPIO_HPS_TX : integer := 24;
end package top_pkg;

10
fpgapei.code-workspace Normal file
View file

@ -0,0 +1,10 @@
{
"folders": [
{
"path": ".."
}
],
"settings": {
"makefile.makefilePath": "/mnt/c/Projects/fpgapei/fpgahome/firmware/top/src/test/"
}
}