diff --git a/generic_ip/fire_pulse_manager/5/Readme.txt b/generic_ip/fire_pulse_manager/5/Readme.txt new file mode 100644 index 0000000..63b3fad --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/Readme.txt @@ -0,0 +1 @@ +FPM Major version 5: FPM with Programmable number of channels \ No newline at end of file diff --git a/generic_ip/fire_pulse_manager/5/build/fire_pulse_manager_5.qip b/generic_ip/fire_pulse_manager/5/build/fire_pulse_manager_5.qip new file mode 100644 index 0000000..5a5c06a --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/build/fire_pulse_manager_5.qip @@ -0,0 +1,65 @@ +set_global_assignment -name IP_TOOL_NAME "fire_pulse_manager_5" +set_global_assignment -name IP_TOOL_VERSION "18.0" +set_global_assignment -name IP_GENERATED_DEVICE_FAMILY "{Cyclone V}" + +set COMMON_PATH ../../../common/0/src +set POF_PATH_0 ../../../pof_protocol/0/src +set POF_PATH_1 ../../../pof_protocol/1/src +set SEQUENCER_PATH ../../../generic_sequencer/15/src +set PULSE_GEN_PATH ../../../pulse_generator/2/src +set EMUL_PATH ../../../enc_pd_emul/1/src +set LOG_PATH ../../../event_logger/0/src +set SRC_PATH ../src + +# common +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/sync_reset.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/common_pkg.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/sync_wire.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/sync_wire_rEdge.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/altera/sync_fifo.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/queue_and_delay.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/dpram_sclk.vhd"] + +# Generic Sequencer +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SEQUENCER_PATH/altera/generic_seq_ram_15.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SEQUENCER_PATH/generic_sequencer_15_pkg.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SEQUENCER_PATH/generic_sequencer_15.vhd"] + +# Pulse Generator +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$PULSE_GEN_PATH/pulse_conditioning_2.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$PULSE_GEN_PATH/simple_frac_div_2.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$PULSE_GEN_PATH/pulse_generator_2_pkg.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$PULSE_GEN_PATH/pulse_generator_2.vhd"] + +# Emulator +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$EMUL_PATH/enc_pd_emul_1_pkg.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$EMUL_PATH/enc_pd_emul_1.vhd"] + +# Event Logger +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$LOG_PATH/event_logger_0_pkg.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$LOG_PATH/event_logger_0.vhd"] + +# POF-Rx +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_0/pof_uart_rx_0.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_0/pof_rx_0.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_0/pof_uart_regen_0.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_0/uart_tx_0.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_0/pof_tx_0.vhd"] + +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_1/pof_uart_rx_1.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_1/pof_rx_1.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_1/pof_uart_regen_1.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_1/uart_tx_1.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$POF_PATH_1/pof_tx_1.vhd"] + +# Fire-Pulse-Manager +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$COMMON_PATH/cs_bus_itf.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SRC_PATH/smb_diagnostics_5.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SRC_PATH/simple_enc_vel_detect_5.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SRC_PATH/fire_pulse_5_pkg.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SRC_PATH/fire_pulse_ctrl_5.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SRC_PATH/fire_pulse_ext_5.vhd"] +set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "$SRC_PATH/fire_pulse_manager_5.vhd"] + + + diff --git a/generic_ip/fire_pulse_manager/5/build/fire_pulse_manager_5_hw.tcl b/generic_ip/fire_pulse_manager/5/build/fire_pulse_manager_5_hw.tcl new file mode 100644 index 0000000..ff96520 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/build/fire_pulse_manager_5_hw.tcl @@ -0,0 +1,294 @@ +# TCL File Generated by Component Editor 16.0 +# Wed Oct 25 15:26:07 BST 2017 +# DO NOT MODIFY + + +# +# fire_pulse_manager_0 "fire_pulse_manager_5" v1.0 +# GMG 2017.10.25.15:26:07 +# Fire Pulse Manager +# + +# +# request TCL package from ACDS 16.0 +# +package require -exact qsys 16.0 + + +# +# module fire_pulse_manager_0 +# +set_module_property DESCRIPTION "Fire Pulse Manager" +set_module_property NAME fire_pulse_manager_5 +set_module_property VERSION 1.0 +set_module_property INTERNAL false +set_module_property OPAQUE_ADDRESS_MAP true +set_module_property GROUP "GIS Components" +set_module_property AUTHOR GMG +set_module_property DISPLAY_NAME fire_pulse_manager_5 +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 fire_pulse_manager_5 +set_fileset_property QUARTUS_SYNTH ENABLE_RELATIVE_INCLUDE_PATHS false +set_fileset_property QUARTUS_SYNTH ENABLE_FILE_OVERWRITE_MODE false +#add_fileset_file pkg_functions.vhd VHDL PATH ../../../common/0/src/pkg_functions.vhd +add_fileset_file common_pkg.vhd VHDL PATH ../../../common/0/src/common_pkg.vhd +add_fileset_file sync_reset.vhd VHDL PATH ../../../common/0/src/sync_reset.vhd +add_fileset_file sync_wire.vhd VHDL PATH ../../../common/0/src/sync_wire.vhd +add_fileset_file sync_wire_rEdge.vhd VHDL PATH ../../../common/0/src/sync_wire_rEdge.vhd +add_fileset_file fifo_1024x32.vhd VHDL PATH ../../../common/0//src/altera/fifo_1024x32.vhd +add_fileset_file fifo_256x32.vhd VHDL PATH ../../../common/0/src/altera/fifo_256x32.vhd +add_fileset_file sync_fifo.vhd VHDL PATH ../../../common/0/src/altera/sync_fifo.vhd +add_fileset_file cs_bus_itf.vhd VHDL PATH ../../../common/0/src/cs_bus_itf.vhd +add_fileset_file dpram_sclk.vhd VHDL PATH ../../../common/0/src/dpram_sclk.vhd +add_fileset_file generic_seq_ram_15.vhd VHDL PATH ../../../generic_sequencer/15/src/altera/generic_seq_ram_15.vhd +add_fileset_file generic_sequencer_15_pkg.vhd VHDL PATH ../../../generic_sequencer/15/src/generic_sequencer_15_pkg.vhd +add_fileset_file generic_sequencer_15.vhd VHDL PATH ../../../generic_sequencer/15/src/generic_sequencer_15.vhd +add_fileset_file enc_pd_emul_1_pkg.vhd VHDL PATH ../../../enc_pd_emul/1/src/enc_pd_emul_1_pkg.vhd +add_fileset_file enc_pd_emul_1.vhd VHDL PATH ../../../enc_pd_emul/1/src/enc_pd_emul_1.vhd +add_fileset_file event_logger_0_pkg.vhd VHDL PATH ../../../event_logger/0/src/event_logger_0_pkg.vhd +add_fileset_file event_logger_0.vhd VHDL PATH ../../../event_logger/0/src/event_logger_0.vhd +add_fileset_file pulse_conditioning_2.vhd VHDL PATH ../../../pulse_generator/2/src/pulse_conditioning_2.vhd +add_fileset_file queue_and_delay.vhd VHDL PATH ../../../common/0/src/queue_and_delay.vhd +add_fileset_file simple_frac_div_2.vhd VHDL PATH ../../../pulse_generator/2/src/simple_frac_div_2.vhd +add_fileset_file pulse_generator_2_pkg.vhd VHDL PATH ../../../pulse_generator/2/src/pulse_generator_2_pkg.vhd +add_fileset_file pulse_generator_2.vhd VHDL PATH ../../../pulse_generator/2/src/pulse_generator_2.vhd +add_fileset_file pof_uart_rx_0.vhd VHDL PATH ../../../pof_protocol/0/src/pof_uart_rx_0.vhd +add_fileset_file pof_rx_0.vhd VHDL PATH ../../../pof_protocol/0/src/pof_rx_0.vhd +add_fileset_file pof_uart_regen_0.vhd VHDL PATH ../../../pof_protocol/0/src/pof_uart_regen_0.vhd +add_fileset_file pof_uart_rx_1.vhd VHDL PATH ../../../pof_protocol/1/src/pof_uart_rx_1.vhd +add_fileset_file pof_rx_1.vhd VHDL PATH ../../../pof_protocol/1/src/pof_rx_1.vhd +add_fileset_file pof_uart_regen_1.vhd VHDL PATH ../../../pof_protocol/1/src/pof_uart_regen_1.vhd +add_fileset_file smb_diagnostics_2.vhd VHDL PATH ../src/smb_diagnostics_2.vhd +add_fileset_file fire_pulse_5_pkg.vhd VHDL PATH ../src/fire_pulse_5_pkg.vhd +add_fileset_file simple_enc_vel_detect_5.vhd VHDL PATH ../src/simple_enc_vel_detect_5.vhd +add_fileset_file fire_pulse_ctrl_5.vhd VHDL PATH ../src/fire_pulse_ctrl_5.vhd +add_fileset_file fire_pulse_manager_5.vhd VHDL PATH ../src/fire_pulse_manager_5.vhd TOP_LEVEL_FILE + +add_fileset SIM_VHDL SIM_VHDL "" "" +set_fileset_property SIM_VHDL TOP_LEVEL fire_pulse_manager_5 +set_fileset_property SIM_VHDL ENABLE_RELATIVE_INCLUDE_PATHS false +set_fileset_property SIM_VHDL ENABLE_FILE_OVERWRITE_MODE false +add_fileset_file common_pkg.vhd VHDL PATH ../../../common/0/src/common_pkg.vhd +add_fileset_file sync_reset.vhd VHDL PATH ../../../common/0/src/sync_reset.vhd +add_fileset_file sync_wire.vhd VHDL PATH ../../../common/0/src/sync_wire.vhd +add_fileset_file sync_wire_rEdge.vhd VHDL PATH ../../../common/0/src/sync_wire_rEdge.vhd +add_fileset_file fifo_1024x32.vhd VHDL PATH ../../../common/0//src/altera/fifo_1024x32.vhd +add_fileset_file fifo_256x32.vhd VHDL PATH ../../../common/0/src/altera/fifo_256x32.vhd +add_fileset_file sync_fifo.vhd VHDL PATH ../../../common/0/src/altera/sync_fifo.vhd +add_fileset_file cs_bus_itf.vhd VHDL PATH ../../../common/0/src/cs_bus_itf.vhd +add_fileset_file dpram_sclk.vhd VHDL PATH ../../../common/0/src/dpram_sclk.vhd +add_fileset_file generic_seq_ram_15.vhd VHDL PATH ../../../generic_sequencer/15/src/altera/generic_seq_ram_15.vhd +add_fileset_file generic_sequencer_15_pkg.vhd VHDL PATH ../../../generic_sequencer/15/src/generic_sequencer_15_pkg.vhd +add_fileset_file generic_sequencer_15.vhd VHDL PATH ../../../generic_sequencer/15/src/generic_sequencer_15.vhd +add_fileset_file enc_pd_emul_1_pkg.vhd VHDL PATH ../../../enc_pd_emul/1/src/enc_pd_emul_1_pkg.vhd +add_fileset_file enc_pd_emul_1.vhd VHDL PATH ../../../enc_pd_emul/1/src/enc_pd_emul_1.vhd +add_fileset_file event_logger_0_pkg.vhd VHDL PATH ../../../event_logger/0/src/event_logger_0_pkg.vhd +add_fileset_file event_logger_0.vhd VHDL PATH ../../../event_logger/0/src/event_logger_0.vhd +add_fileset_file pulse_conditioning_2.vhd VHDL PATH ../../../pulse_generator/2/src/pulse_conditioning_2.vhd +add_fileset_file queue_and_delay.vhd VHDL PATH ../../../common/0/src/queue_and_delay.vhd +add_fileset_file simple_frac_div_2.vhd VHDL PATH ../../../pulse_generator/2/src/simple_frac_div_2.vhd +add_fileset_file pulse_generator_2_pkg.vhd VHDL PATH ../../../pulse_generator/2/src/pulse_generator_2_pkg.vhd +add_fileset_file pulse_generator_2.vhd VHDL PATH ../../../pulse_generator/2/src/pulse_generator_2.vhd +add_fileset_file pof_uart_rx_0.vhd VHDL PATH ../../../pof_protocol/0/src/pof_uart_rx_0.vhd +add_fileset_file pof_rx_0.vhd VHDL PATH ../../../pof_protocol/0/src/pof_rx_0.vhd +add_fileset_file pof_uart_regen_0.vhd VHDL PATH ../../../pof_protocol/0/src/pof_uart_regen_0.vhd +add_fileset_file pof_uart_rx_1.vhd VHDL PATH ../../../pof_protocol/1/src/pof_uart_rx_1.vhd +add_fileset_file pof_rx_1.vhd VHDL PATH ../../../pof_protocol/1/src/pof_rx_1.vhd +add_fileset_file pof_uart_regen_1.vhd VHDL PATH ../../../pof_protocol/1/src/pof_uart_regen_1.vhd +add_fileset_file smb_diagnostics_2.vhd VHDL PATH ../src/smb_diagnostics_2.vhd +add_fileset_file fire_pulse_5_pkg.vhd VHDL PATH ../src/fire_pulse_5_pkg.vhd +add_fileset_file simple_enc_vel_detect_5.vhd VHDL PATH ../src/simple_enc_vel_detect_5.vhd +add_fileset_file fire_pulse_ctrl_5.vhd VHDL PATH ../src/fire_pulse_ctrl_5.vhd +add_fileset_file fire_pulse_manager_5.vhd VHDL PATH ../src/fire_pulse_manager_5.vhd + + +# +# parameters +# + + +# +# 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 avs +# +add_interface avs avalon end +set_interface_property avs addressUnits WORDS +set_interface_property avs associatedClock clock +set_interface_property avs associatedReset reset +set_interface_property avs bitsPerSymbol 8 +set_interface_property avs burstOnBurstBoundariesOnly false +set_interface_property avs burstcountUnits WORDS +set_interface_property avs explicitAddressSpan 0 +set_interface_property avs holdTime 0 +set_interface_property avs linewrapBursts false +set_interface_property avs maximumPendingReadTransactions 0 +set_interface_property avs maximumPendingWriteTransactions 0 +set_interface_property avs readLatency 0 +set_interface_property avs readWaitTime 1 +set_interface_property avs setupTime 0 +set_interface_property avs timingUnits Cycles +set_interface_property avs writeWaitTime 0 +set_interface_property avs ENABLED true +set_interface_property avs EXPORT_OF "" +set_interface_property avs PORT_NAME_MAP "" +set_interface_property avs CMSIS_SVD_VARIABLES "" +set_interface_property avs SVD_ADDRESS_GROUP "" + +add_interface_port avs avs_address address Input 15 +add_interface_port avs avs_write write Input 1 +add_interface_port avs avs_writedata writedata Input 32 +add_interface_port avs avs_read read Input 1 +add_interface_port avs avs_readdata readdata Output 32 +add_interface_port avs avs_waitrequest waitrequest Output 1 +set_interface_assignment avs embeddedsw.configuration.isFlash 0 +set_interface_assignment avs embeddedsw.configuration.isMemoryDevice 0 +set_interface_assignment avs embeddedsw.configuration.isNonVolatileStorage 0 +set_interface_assignment avs embeddedsw.configuration.isPrintableDevice 0 + + +# +# connection point conduit_end +# +add_interface conduit_end conduit end +set_interface_property conduit_end associatedClock clock +set_interface_property conduit_end associatedReset reset +set_interface_property conduit_end ENABLED true +set_interface_property conduit_end EXPORT_OF "" +set_interface_property conduit_end PORT_NAME_MAP "" +set_interface_property conduit_end CMSIS_SVD_VARIABLES "" +set_interface_property conduit_end SVD_ADDRESS_GROUP "" + +add_interface_port conduit_end pof_rx pof_rx Input 1 +add_interface_port conduit_end pof_tx pof_tx Output 1 +add_interface_port conduit_end pof_iso_en pof_iso_en Output 1 +add_interface_port conduit_end fire_pulse fire_pulse Output 1 +add_interface_port conduit_end abs_pos_out abs_pos_out Output 32 +add_interface_port conduit_end print_start print_start Output 1 +add_interface_port conduit_end mon_pt mon_pt Output 4 + + +# +# connection point rx_clk +# +add_interface rx_clk clock end +set_interface_property rx_clk clockRate 0 +set_interface_property rx_clk ENABLED true +set_interface_property rx_clk EXPORT_OF "" +set_interface_property rx_clk PORT_NAME_MAP "" +set_interface_property rx_clk CMSIS_SVD_VARIABLES "" +set_interface_property rx_clk SVD_ADDRESS_GROUP "" + +add_interface_port rx_clk rx_clk clk Input 1 + + +# +# connection point irq_0 +# +add_interface irq_0 interrupt end +set_interface_property irq_0 associatedAddressablePoint "" +set_interface_property irq_0 associatedClock clock +set_interface_property irq_0 associatedReset reset +set_interface_property irq_0 bridgedReceiverOffset "" +set_interface_property irq_0 bridgesToReceiver "" +set_interface_property irq_0 ENABLED true +set_interface_property irq_0 EXPORT_OF "" +set_interface_property irq_0 PORT_NAME_MAP "" +set_interface_property irq_0 CMSIS_SVD_VARIABLES "" +set_interface_property irq_0 SVD_ADDRESS_GROUP "" + +add_interface_port irq_0 ins_fpm_irq_0 irq Output 1 + +# +# connection point irq_1 +# +add_interface irq_1 interrupt end +set_interface_property irq_1 associatedAddressablePoint "" +set_interface_property irq_1 associatedClock clock +set_interface_property irq_1 associatedReset reset +set_interface_property irq_1 bridgedReceiverOffset "" +set_interface_property irq_1 bridgesToReceiver "" +set_interface_property irq_1 ENABLED true +set_interface_property irq_1 EXPORT_OF "" +set_interface_property irq_1 PORT_NAME_MAP "" +set_interface_property irq_1 CMSIS_SVD_VARIABLES "" +set_interface_property irq_1 SVD_ADDRESS_GROUP "" + +add_interface_port irq_1 ins_fpm_irq_1 irq Output 1 + +# +# connection point irq_2 +# +add_interface irq_2 interrupt end +set_interface_property irq_2 associatedAddressablePoint "" +set_interface_property irq_2 associatedClock clock +set_interface_property irq_2 associatedReset reset +set_interface_property irq_2 bridgedReceiverOffset "" +set_interface_property irq_2 bridgesToReceiver "" +set_interface_property irq_2 ENABLED true +set_interface_property irq_2 EXPORT_OF "" +set_interface_property irq_2 PORT_NAME_MAP "" +set_interface_property irq_2 CMSIS_SVD_VARIABLES "" +set_interface_property irq_2 SVD_ADDRESS_GROUP "" + +add_interface_port irq_2 ins_fpm_irq_2 irq Output 1 + +# +# connection point irq_3 +# +add_interface irq_3 interrupt end +set_interface_property irq_3 associatedAddressablePoint "" +set_interface_property irq_3 associatedClock clock +set_interface_property irq_3 associatedReset reset +set_interface_property irq_3 bridgedReceiverOffset "" +set_interface_property irq_3 bridgesToReceiver "" +set_interface_property irq_3 ENABLED true +set_interface_property irq_3 EXPORT_OF "" +set_interface_property irq_3 PORT_NAME_MAP "" +set_interface_property irq_3 CMSIS_SVD_VARIABLES "" +set_interface_property irq_3 SVD_ADDRESS_GROUP "" + +add_interface_port irq_3 ins_fpm_irq_3 irq Output 1 + diff --git a/generic_ip/fire_pulse_manager/5/doc/fpm_5.json b/generic_ip/fire_pulse_manager/5/doc/fpm_5.json new file mode 100644 index 0000000..68b44dd --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/doc/fpm_5.json @@ -0,0 +1,55 @@ +[{ + "ip_name" : "fpm_5", + "bus" : "csr", + "addr_hi_bit" : "14", + "addr_lo_bit" : "11", + "description" : "Fire-Pulse-Manager version 5", + "sub_blocks" : { + "fpm_ctrl_5" : { + "instance" : "", + "process" : "cpp, txt", + "offset" : "0x0000" + }, + "fpm_diags_5" : { + "instance" : "", + "process" : "cpp, txt", + "note" : "This block is instantiated only when generic ADD_SMB_DIAG is set to true", + "offset" : "0x0800" + }, + "event_logger_0" : { + "instance" : "", + "process" : "cpp, txt", + "note" : "This block is instantiated only when generic ADD_EVENT_LOGGER is set to true", + "offset" : "0x1000" + }, + "enc_pd_emul_1" : { + "instance" : "", + "process" : "cpp, txt", + "offset" : "0x1800" + }, + "pulse_generator_2:a" : { + "instance" : "0", + "process" : "cpp, txt", + "offset" : "0x2000" + }, + "pulse_generator_2:b" : { + "instance" : "1", + "process" : "cpp, txt", + "note" : "This block may not be instantiated depending on the value of generic CH_NUM specified in the FPM top-level", + "offset" : "0x2800" + }, + "pulse_generator_2:c" : { + "instance" : "2", + "process" : "cpp, txt", + "note" : "This block may not be instantiated depending on the value of generic CH_NUM specified in the FPM top-level", + "offset" : "0x3000" + }, + "pulse_generator_2:d" : { + "instance" : "3", + "process" : "cpp, txt", + "note" : "This block may not be instantiated depending on the value of generic CH_NUM specified in the FPM top-level", + "offset" : "0x3800" + } + } +} +] \ No newline at end of file diff --git a/generic_ip/fire_pulse_manager/5/doc/fpm_ctrl_5.json b/generic_ip/fire_pulse_manager/5/doc/fpm_ctrl_5.json new file mode 100644 index 0000000..27868c8 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/doc/fpm_ctrl_5.json @@ -0,0 +1,310 @@ +[{ + "ip_name": "fpm_ctrl_5", + "bus": "csr", + "description": "This block is the fire pulse manager control", + "registers": { + "ip_id" : { + "address" : "0", + "width" : "32", + "description" : "Unique ID for this IP block", + "fields": { + "ip_number" : { + "type" : "c", + "bit_len" : "8", + "reset" : "0x14", + "description" : "IP identifier number" + }, + "mfr_number" : { + "type" : "c", + "bit_len" : "8", + "reset" : "0xFF", + "description" : "Manufacturer number" + + }, + "reserved" : { + "type" : "rsv", + "bit_len" : "16", + "description" : "Reserved bits" + } + } + }, + "ip_ver" : { + "address" : "1", + "width" : "32", + "description" : "IP Version", + "fields": { + "minor_number" : { + "type" : "c", + "bit_len" : "8", + "reset" : "0x00", + "description" : "Minor number" + }, + "major_number" : { + "type" : "c", + "bit_len" : "8", + "reset" : "0x04", + "description" : "Major number" + + }, + "reserved" : { + "type" : "rsv", + "bit_len" : "16", + "description" : "Reserved bits" + } + } + }, + "Signal selection": { + "address": "2", + "width": "2", + "description": "Controls signal selection", + "fields": { + "fire_pulse_sel": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Use External fire pulses, 1 => Use FPM fire pulses" + }, + "enc_pd_emul_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Use POF RX, 1 => Use internal enc/PD emulator" + } + } + }, + "pof_receiver_control": { + "address": "3", + "width": "8", + "description": "Controls POF receiver", + "fields": { + "pof_rx_enable": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Disable POF RX, 1 => Enable POF RX" + }, + "uart_regeneration_bypass": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Use UART Regeneration, 1 => Bypass UART Regeneration" + }, + "clear_max": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Disabled, 1 => Load the current value of Absolute Position as new maximum" + }, + "clear_min": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Disabled, 1 => Load the current value of Absolute Position as new miniumum" + }, + "uart_rx_div": { + "type": "w", + "bit_len": "4", + "reset": "0x4", + "description": "Defines the number of 200 MHz clock cycles per UART data bit" + } + } + }, + "monitoring_point_selection": { + "address": "4", + "width": "16", + "description": "Selects monitoring points for external header", + "fields": { + "mp0": { + "type": "w", + "bit_len": "4", + "reset": "0x0", + "description": "Selects first monitoring point" + }, + "mp1": { + "type": "w", + "bit_len": "4", + "reset": "0x0", + "description": "Selects second monitoring point" + }, + "mp2": { + "type": "w", + "bit_len": "4", + "reset": "0x0", + "description": "Selects third monitoring point" + }, + "mp3": { + "type": "w", + "bit_len": "4", + "reset": "0x0", + "description": "Selects fourth monitoring point" + } + } + }, + "coarse_time_init": { + "type": "w", + "address": "5", + "reset": "0x00000000", + "width": "32", + "description": "Defines coarse time counter value" + }, + "fine_time_init": { + "address": "6", + "width": "29", + "description": "Fine time counter value/Load counter enable", + "fields": { + "fine_time_init": { + "type" :"w", + "bit_len": "28", + "reset": "0x0000000", + "description": "Defines fine time counter value" + }, + "time_load_en": { + "type" :"w", + "bit_len" : "1", + "reset": "0x0", + "description" : "Writting 1 loads the coarse and fine time counters" + } + } + }, + "fine_time_status": { + "type": "r", + "address": "7", + "reset": "0x0000000", + "width": "28", + "description": "Current fine time counter value" + }, + "coarse_time_status": { + "type": "r", + "address": "8", + "reset": "0x00000000", + "width": "32", + "description": "Current coarse time counter value" + }, + "pof_rx_status": { + "address": "9", + "width": "32", + "description": "Status of POF receiver", + "fields": { + "parity_bit_error_count": { + "type": "r", + "bit_len": "16", + "reset": "0x0000", + "description": "Counts number of parity errors" + }, + "skipped_position_error_count": { + "type": "r", + "bit_len": "16", + "reset": "0x0000", + "description": "Counts position skipped type errors" + } + } + }, + "pof_rx_control": { + "address": "10", + "width": "12", + "description": "POF receiver error control", + "fields": { + "error_rate_thres": { + "type" : "w", + "bit_len": "8", + "reset": "0x0A", + "description": "Defines RX error rate threshold" + }, + "rx_watchdog_en": { + "type": "w", + "bit_len": "1", + "reset": "0x1", + "description": "0 => Disable RX watchdog, 1 => Enable RX Watchdog" + }, + "rx_watchdog_clr": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => RX watchdog counter running, 1 => Clear RX watchdog counter" + }, + "rx_watchdog": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "0 => RX watchdog not triggered, 1 => RX watchdog triggered" + }, + "rx_error_flag": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Error rate below threshold, 1 => Error rate above threshold" + } + } + }, + "fpm_interrupt": { + "address": "11", + "width": "16", + "description": "Interrupt control", + "fields": { + "irq_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Disable IRQ, 1 => Enable IRQ" + }, + "reserved1": { + "type": "rsv", + "bit_len": "3", + "description": "Reserved" + }, + "irq_clr": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => Don't clear pending IRQ, 1 => Clear pending IRQ" + }, + "reserved2": { + "type": "rsv", + "bit_len": "3", + "description": "Reserved" + }, + "irq_mask": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "0 => IRQ not masked, 1 => IRQ masked" + }, + "reserved3": { + "type": "rsv", + "bit_len": "3", + "description": "Reserved" + }, + "irq_status": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "0 => IRQ not active, 1 => IRQ active" + }, + "reserved4": { + "type": "rsv", + "bit_len": "3", + "description": "Reserved" + } + } + }, + "fpm_ext_ctrl": { + "address": "12", + "width": "32", + "description": "Controls regeneration of external fire pulses", + "fields": { + "ext_fp_det": { + "type": "w", + "bit_len": "16", + "reset": "0x0010", + "description": "Minimum width of external fire pulses" + }, + "ext_fp_gen": { + "type": "w", + "bit_len": "16", + "reset": "0x0020", + "description": "Width of regenerated external fire pulses" + } + } + } + } + }] \ No newline at end of file diff --git a/generic_ip/fire_pulse_manager/5/doc/fpm_diags_5.json b/generic_ip/fire_pulse_manager/5/doc/fpm_diags_5.json new file mode 100644 index 0000000..0ec64dd --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/doc/fpm_diags_5.json @@ -0,0 +1,495 @@ +[{ + "ip_name": "fpm_diags_5", + "bus": "csr", + "description": "SMB diagnostics", + "registers": { + "init": { + "address": "0", + "width": "7", + "description": "Diagnostic reset", + "fields": { + "init": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "initialize the full diagnostic block" + }, + "rst_counters": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "reset only edge counters" + }, + "rst_measur": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "reset only time-based velocity/acceleration measurement registers" + }, + "rst_dir": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "reset only the logic for direction detection" + }, + "rst_enc_fifo": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "reset only the encoder fifo" + }, + "rst_pos": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "reset only the position detection register" + }, + "rst_pd_fifo": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "reset only the PD fifo" + } + } + }, + "input_status": { + "address": "1", + "width": "17", + "description": "Instantaneous status of input signals", + "fields": { + "rs422_p1": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "RS422 encoder phase-1" + }, + "rs422_p2": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "RS422 encoder phase-2" + }, + "rs422_zp": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "RS422 encoder zero-phase" + }, + "rs422_pd": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "RS422 Product Detect" + }, + "ttl_p1": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "TTL encoder phase-1" + }, + "ttl_p2": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "TTL encoder phase-2" + }, + "ttl_zp": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "TTL encoder zero-phase" + }, + "ttl_pd_pnp": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "TTL (PNP) Product Detect" + }, + "ttl_pd_npn": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "TTL (NPN) Product Detect" + }, + "filt_p1": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "EMS filtered p1" + }, + "filt_p2": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "EMS filtered p2" + }, + "filt_zp": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "EMS filtered zp" + }, + "filt_pd": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "EMS filtered pd" + }, + "enc_pulse": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "enc_pulse (after jitter removal)" + }, + "pd_out": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "PD output" + }, + "drop_watch": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "drop watch)" + }, + "fire_req": { + "type": "r", + "bit_len": "1", + "reset": "0x00", + "description": "fire request" + } + } + }, + "phase1_counter": { + "type": "r", + "address": "2", + "reset": "0x0", + "width": "32", + "description": "Encoder Phase-1 (filtered) edge counter" + }, + "phase2_counter": { + "type": "r", + "address": "3", + "reset": "0x0", + "width": "32", + "description": "Encoder Phase-2 (filtered) edge counter" + }, + "zero_phase_counter": { + "type": "r", + "address": "4", + "reset": "0x0", + "width": "32", + "description": "Encoder Zero-Phase (filtered) edge counter" + }, + "pd_counter": { + "type": "r", + "address": "5", + "reset": "0x0", + "width": "32", + "description": "PD (filtered) edge counter" + }, + "enc_pulse_counter": { + "type": "r", + "address": "6", + "reset": "0x0", + "width": "32", + "description": "encoder pulse counter (after jitter removal)" + }, + "pd_output_counter": { + "type": "r", + "address": "7", + "reset": "0x0", + "width": "32", + "description": "PD output edge counter" + }, + "fire_request_counter": { + "type": "r", + "address": "8", + "reset": "0x0", + "width": "32", + "description": "Fire-Request counter" + }, + "aux_in_0_counter": { + "type": "r", + "address": "9", + "reset": "0x0", + "width": "32", + "description": "aux_in_0 counter" + }, + "aux_in_1_counter": { + "type": "r", + "address": "10", + "reset": "0x0", + "width": "32", + "description": "aux_in_1 counter" + }, + "aux_in_2_counter": { + "type": "r", + "address": "11", + "reset": "0x0", + "width": "32", + "description": "aux_in_2 counter" + }, + "delta_time_meas": { + "type": "r", + "address": "12", + "reset": "0x0", + "width": "32", + "description": "Delta-time measurement" + }, + "deltamin_time_meas": { + "type": "r", + "address": "13", + "reset": "0x0", + "width": "32", + "description": "Delta-time-min measurement" + }, + "deltamax_time_meas": { + "type": "r", + "address": "14", + "reset": "0x0", + "width": "32", + "description": "Delta-time-max measurement" + }, + "delta_time_prev_meas": { + "type": "r", + "address": "15", + "reset": "0x0", + "width": "32", + "description": "Previous delta-time measurement" + }, + "delta_time_meas_step": { + "type": "w", + "address": "16", + "reset": "0x0", + "width": "16", + "description": "Delta-time measurement step" + }, + "abs_pos": { + "type": "r", + "address": "17", + "reset": "0x0", + "width": "32", + "description": "Detected absolution position (DEPRECATED)" + }, + "dir_thres": { + "address": "18", + "width": "32", + "description": "Direction detection control", + "fields": { + "pos_dir_thres": { + "type": "w", + "bit_len": "16", + "reset": "0x007F", + "description": "threshold for positive direction detection" + }, + "neg_dir_thres": { + "type": "w", + "bit_len": "16", + "reset": "0xFF81", + "description": "threshold for negative direction detection" + } + } + }, + "dir_cnt": { + "address": "19", + "width": "32", + "description": "Direction status", + "fields": { + "dir_cnt": { + "type": "r", + "bit_len": "16", + "reset": "0x0", + "description": "direction count" + }, + "dir_change_cnt": { + "type": "r", + "bit_len": "16", + "reset": "0x0", + "description": "direction change count" + } + } + }, + "enc_sampling_period": { + "type": "w", + "address": "20", + "reset": "0x0", + "width": "28", + "description": "Encoder sampling period (encoder FIFO)" + }, + "enc_fifo_mng": { + "address": "21", + "width": "32", + "description": "encoder FIFO management", + "fields": { + "irq_gen_thres": { + "type": "w", + "bit_len": "10", + "reset": "0x0", + "description": "FIFO IRQ threshold" + }, + "reserved-0" : { + "type" : "rsv", + "bit_len" : "6", + "description" : "Reserved bits" + }, + "fifo_level": { + "type": "r", + "bit_len": "10", + "reset": "0x0", + "description": "fifo level" + }, + "reserved-1" : { + "type" : "rsv", + "bit_len" : "5", + "description" : "Reserved bits" + }, + "fifo_overflow": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "fifo overflow flag" + } + } + }, + "enc_fifo_output": { + "type": "r", + "address": "22", + "reset": "0x0", + "width": "32", + "description": "Encoder FIFO output" + }, + "pd_fifo_mng": { + "address": "23", + "width": "32", + "description": "encoder FIFO management", + "fields": { + "irq_gen_thres": { + "type": "w", + "bit_len": "10", + "reset": "0x0", + "description": "FIFO IRQ threshold" + }, + "reserved-0" : { + "type" : "rsv", + "bit_len" : "5", + "description" : "Reserved bits" + }, + "pd_log_src": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "PD log source: 0 => PD-FIFO associated to Filtered-PD input, 1 => PD-FIFO associated to PD-out input" + }, + "fifo_level": { + "type": "r", + "bit_len": "10", + "reset": "0x0", + "description": "fifo level" + }, + "reserved-1" : { + "type" : "rsv", + "bit_len" : "5", + "description" : "Reserved bits" + }, + "fifo_overflow": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "fifo overflow flag" + } + } + }, + "pd_fifo_output": { + "type": "r", + "address": "24", + "reset": "0x0", + "width": "32", + "description": "PD FIFO output" + }, + "pd_watchdog_ctrl": { + "address": "25", + "width": "5", + "description": "PD watchdog control", + "fields": { + "watchdog_en": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "PD watchdog enable" + }, + "watchdog_clr": { + "type": "w", + "bit_len": "1", + "reset": "0x0", + "description": "PD watchdog clear" + }, + "reserved" : { + "type" : "rsv", + "bit_len" : "2", + "description" : "Reserved bits" + }, + "watchdog_status": { + "type": "r", + "bit_len": "1", + "reset": "0x0", + "description": "watchdog status" + } + } + }, + "pd_watchdog_thres": { + "type": "w", + "address": "26", + "reset": "0x0", + "width": "32", + "description": "PD watchdog threshold" + }, + "irq_mng": { + "address": "27", + "width": "15", + "description": "Diagnostic block IRQ management", + "fields": { + "irq_en": { + "type": "w", + "bit_len": "3", + "reset": "0x0", + "description": "IRQ enable" + }, + "reserved-0" : { + "type" : "rsv", + "bit_len" : "1", + "description" : "Reserved bits" + }, + "irq_clr": { + "type": "w", + "bit_len": "3", + "reset": "0x0", + "description": "IRQ clear" + }, + "reserved-1" : { + "type" : "rsv", + "bit_len" : "1", + "description" : "Reserved bits" + }, + "irq_mask": { + "type": "w", + "bit_len": "3", + "reset": "0x0", + "description": "IRQ mask" + }, + "reserved-2" : { + "type" : "rsv", + "bit_len" : "1", + "description" : "Reserved bits" + }, + "irq_val": { + "type": "w", + "bit_len": "3", + "reset": "0x0", + "description": "IRQ value" + } + } + } + } +}] \ No newline at end of file diff --git a/generic_ip/fire_pulse_manager/5/sim/sim_fpm.do b/generic_ip/fire_pulse_manager/5/sim/sim_fpm.do new file mode 100644 index 0000000..0193c49 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/sim/sim_fpm.do @@ -0,0 +1,113 @@ +# Multi-channel FPM Simulation macro + +.main clear + +# Cleanup libraries +foreach lib [list work OSVVM] { + file delete -force -- $lib + vlib $lib +} + +# Path variables +set COMMON_PATH ../../../common/0/src +set POF_PATH_0 ../../../pof_protocol/0/src +set POF_PATH_1 ../../../pof_protocol/1/src +set SEQUENCER_PATH ../../../generic_sequencer/15/src +set PULSE_GEN_PATH ../../../pulse_generator/2/src +set EMUL_PATH ../../../enc_pd_emul/1/src +set LOG_PATH ../../../event_logger/0/src +set SRC_PATH ../src +set OSVVM_PATH ../../../common/0/src/test/OSVVM +set TB_PATH ../src/test + +set WORKLIB work + +vlib ./work +vmap work ./work + +# common +vcom -2008 -work $WORKLIB $COMMON_PATH/sync_reset.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/common_pkg.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/sync_wire.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/sync_wire_rEdge.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/altera/sync_fifo.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/queue_and_delay.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/dpram_sclk.vhd + +# Generic Sequencer +vcom -2008 -work $WORKLIB $SEQUENCER_PATH/altera/generic_seq_ram_15.vhd +vcom -2008 -work $WORKLIB $SEQUENCER_PATH/generic_sequencer_15_pkg.vhd +vcom -2008 -work $WORKLIB $SEQUENCER_PATH/generic_sequencer_15.vhd + +# Pulse Generator +vcom -2008 -work $WORKLIB $PULSE_GEN_PATH/pulse_conditioning_2.vhd +vcom -2008 -work $WORKLIB $PULSE_GEN_PATH/simple_frac_div_2.vhd +vcom -2008 -work $WORKLIB $PULSE_GEN_PATH/pulse_generator_2_pkg.vhd +vcom -2008 -work $WORKLIB $PULSE_GEN_PATH/pulse_generator_2.vhd + +# Emulator +vcom -2008 -work $WORKLIB $EMUL_PATH/enc_pd_emul_1_pkg.vhd +vcom -2008 -work $WORKLIB $EMUL_PATH/enc_pd_emul_1.vhd + +# Event Logger +vcom -2008 -work $WORKLIB $LOG_PATH/event_logger_0_pkg.vhd +vcom -2008 -work $WORKLIB $LOG_PATH/event_logger_0.vhd + +# POF-Rx +vcom -2008 -work $WORKLIB $POF_PATH_0/pof_uart_rx_0.vhd +vcom -2008 -work $WORKLIB $POF_PATH_0/pof_rx_0.vhd +vcom -2008 -work $WORKLIB $POF_PATH_0/pof_uart_regen_0.vhd +vcom -2008 -work $WORKLIB $POF_PATH_0/uart_tx_0.vhd +vcom -2008 -work $WORKLIB $POF_PATH_0/pof_tx_0.vhd + +vcom -2008 -work $WORKLIB $POF_PATH_1/pof_uart_rx_1.vhd +vcom -2008 -work $WORKLIB $POF_PATH_1/pof_rx_1.vhd +vcom -2008 -work $WORKLIB $POF_PATH_1/pof_uart_regen_1.vhd +vcom -2008 -work $WORKLIB $POF_PATH_1/uart_tx_1.vhd +vcom -2008 -work $WORKLIB $POF_PATH_1/pof_tx_1.vhd + +# Fire-Pulse-Manager +vcom -2008 -work $WORKLIB $COMMON_PATH/cs_bus_itf.vhd +vcom -2008 -work $WORKLIB $SRC_PATH/smb_diagnostics_5.vhd +vcom -2008 -work $WORKLIB $SRC_PATH/simple_enc_vel_detect_5.vhd +vcom -2008 -work $WORKLIB $SRC_PATH/fire_pulse_5_pkg.vhd +vcom -2008 -work $WORKLIB $SRC_PATH/fire_pulse_ctrl_5.vhd +vcom -2008 -work $WORKLIB $SRC_PATH/fire_pulse_ext_5.vhd +vcom -2008 -work $WORKLIB $SRC_PATH/fire_pulse_manager_5.vhd + +# Compile the testbench support files: +# Compile OSVVM lib +vlib OSVVM +vcom -2008 -work OSVVM $OSVVM_PATH/RandomBasePkg.vhd +vcom -2008 -work OSVVM $OSVVM_PATH/SortListPkg_int.vhd +vcom -2008 -work OSVVM $OSVVM_PATH/RandomPkg.vhd + +# Compile the testbench support files: +vcom -2008 -work $WORKLIB $COMMON_PATH/test/common_test_pkg.vhd +vcom -2008 -work $WORKLIB $COMMON_PATH/test/log_pkg.vhd + +# Compile the VHDL packages that support bus protocols, memory mapped registers and functional procedures +vcom -2008 -work $WORKLIB $COMMON_PATH/test/avalon_verify_pkg.vhd + +# Testbench +vcom -2008 -work $WORKLIB $TB_PATH/fire_pulse_manager_5_tb.vhd + +# Load design +vsim -t ps work.fire_pulse_manager_5_tb + +# Add waves +#add wave -r sim:/fire_pulse_manager_1_tb/* +do wave_fpm.do + +# remove warnings from standard numeric/arithmetic packages (speed-up simulation) +set StdArithNoWarnings 1 +set NumericStdNoWarnings 1 + +when -label end_of_simulation {test_completed == true} {echo "Simulation Completed"; stop ;} +run -all + + + + + + diff --git a/generic_ip/fire_pulse_manager/5/sim/wave_fpm.do b/generic_ip/fire_pulse_manager/5/sim/wave_fpm.do new file mode 100644 index 0000000..ea34572 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/sim/wave_fpm.do @@ -0,0 +1,403 @@ +onerror {resume} +quietly WaveActivateNextPane {} 0 +add wave -noupdate -group TB /fire_pulse_manager_5_tb/ch_offset +add wave -noupdate -group TB /fire_pulse_manager_5_tb/reset_n +add wave -noupdate -group TB /fire_pulse_manager_5_tb/clk +add wave -noupdate -group TB /fire_pulse_manager_5_tb/rx_clk +add wave -noupdate -group TB /fire_pulse_manager_5_tb/pof_tx +add wave -noupdate -group TB /fire_pulse_manager_5_tb/pof_rx +add wave -noupdate -group TB -expand /fire_pulse_manager_5_tb/ch_pulse_out +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_address +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_write +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_writedata +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_read +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_waitrequest +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_readdata +add wave -noupdate -group TB /fire_pulse_manager_5_tb/init_tx +add wave -noupdate -group TB /fire_pulse_manager_5_tb/pd_in +add wave -noupdate -group TB /fire_pulse_manager_5_tb/pd_spy +add wave -noupdate -group TB /fire_pulse_manager_5_tb/inc_pos +add wave -noupdate -group TB /fire_pulse_manager_5_tb/dec_pos +add wave -noupdate -group TB -radix hexadecimal /fire_pulse_manager_5_tb/abs_position +add wave -noupdate -group TB /fire_pulse_manager_5_tb/abs_spy +add wave -noupdate -group TB /fire_pulse_manager_5_tb/tx_data +add wave -noupdate -group TB /fire_pulse_manager_5_tb/abs_position_d +add wave -noupdate -group TB /fire_pulse_manager_5_tb/dir_in +add wave -noupdate -group TB /fire_pulse_manager_5_tb/swathe_cnt +add wave -noupdate -group TB /fire_pulse_manager_5_tb/swathe_pos +add wave -noupdate -group TB /fire_pulse_manager_5_tb/end_of_swathe +add wave -noupdate -group TB /fire_pulse_manager_5_tb/test_completed +add wave -noupdate -group TB /fire_pulse_manager_5_tb/running +add wave -noupdate -group TB /fire_pulse_manager_5_tb/configuring +add wave -noupdate -group TB /fire_pulse_manager_5_tb/passed +add wave -noupdate -group TB /fire_pulse_manager_5_tb/failed +add wave -noupdate -group TB /fire_pulse_manager_5_tb/stimuli_completed +add wave -noupdate -group TB /fire_pulse_manager_5_tb/detected_error +add wave -noupdate -group TB /fire_pulse_manager_5_tb/registers_read +add wave -noupdate -group TB /fire_pulse_manager_5_tb/reprogram_offset +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_m +add wave -noupdate -group TB /fire_pulse_manager_5_tb/avs_s +add wave -noupdate -group TB /fire_pulse_manager_5_tb/sel_slave_0 +add wave -noupdate -group TB /fire_pulse_manager_5_tb/sel_slave_1 +add wave -noupdate -group TB /fire_pulse_manager_5_tb/pd_cnt +add wave -noupdate -group TB /fire_pulse_manager_5_tb/fp_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/reset_n +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/clk +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/init +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_clk +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_data +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/init_out +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pd_out +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/inc_pos +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/dec_pos +add wave -noupdate -group {POF RX} -radix decimal /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/abs_pos +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/enable +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/error_rate_thres +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/one_pps +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/max_error_flag +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_watchdog +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_watchdog_en +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_watchdog_clr +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/parity_err_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/skip_pos_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/clear +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol_ok +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/inc_pos_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/dec_pos_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/sync_gen +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pd_gen +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol_error +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol_valid +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol_valid_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol_valid_d +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/toggle_sync +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/sync_confirmed +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/sync_toggle_test +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/sync +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/toggle_pd +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pd_confirmed +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pd_toggle_test +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pd +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/valid_pos +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/upd_pos +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/corr_done +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/corr_sign +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/skip_pos +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/apply_corr +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/inc_pos_ii +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/dec_pos_ii +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_error +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_error_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/print_start_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_symbol_val +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/clear_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/skip_pos_d +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pos_recovery +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/max_error_flag_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/clk_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/dist +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/abs_dist +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/skip_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/next_pos_lsb +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/curr_pos_lsb +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/pos_corr +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/max_dist +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_error_v +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/gray_pos +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_symbol_val_v +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/symbol_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_symbol +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/rx_wd_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/parity_err_cnt_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/skip_pos_cnt_i +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/error_rate_cnt +add wave -noupdate -group {POF RX} /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/error_rate +add wave -noupdate -group {POF RX} -radix decimal /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/abs_pos_i +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/reset_n +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/clk +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/init +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/data_out +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/data_out_valid +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/rx_error +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/rx_data +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/rx_data_i +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/data +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/bit_cnt_unary +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/sample_cnt_unary +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/receiving +add wave -noupdate -group UART_RX /fire_pulse_manager_5_tb/iDUT/gPOF/iPOF_RX/iRX_SYMBOL/init_int +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/clk +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/reset_n +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/init +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pd_in +add wave -noupdate -group CH-0 -radix hexadecimal /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abs_position +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enc_vel +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enc_speed_meas_w +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/dp_dir +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_out +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_of_image +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/filtered_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_mask +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/raw_pulse_out +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enc_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_address +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_write +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_writedata +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_read +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_readdatavalid +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_readdata +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/init_de +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/init_qd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enable +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/loc_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pd_queue_error +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_start_req +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pd_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/filt_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/filt_pd_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_write +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_read +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_busy +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enable_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_mask_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/bypass_ch_ctrl +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/bypass_delay_equal +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/gated_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/retimed_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_out_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_write_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_read_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_read_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/de_queue_error +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/cnt_dir +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/dp_dir_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_start_req_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/set_first_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_out_ii +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/loc_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/first_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/dp_dir_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/overdrive_rst +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/overdrv_event +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_scale_out +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_img_req +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_img_req_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_img +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_img_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_img_dd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/fire_enable +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/img_completed +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/sw_ctrl_dp_dir +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enable_out +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_start_req_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/add_img_size +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/add_img_size_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abort_fire +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_csr_write +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_csr_read +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/frac_div_en_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/upd_max_pos +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/upd_min_pos +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/frac_div_en +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/gen_filt_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/upd_max_pos_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/upd_min_pos_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/dir_change +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/first_pd +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pd_in_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/filt_pd_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abs_pos_lsb +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_start_req_ii +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/prevent_div_restart +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/rst_jitter +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/rst_diag_regs +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/fire_req +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/fire_req_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/fire_req_p +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/mid_cross +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/mid_crossed +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/zero_cross +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/close_to_zero +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/close_to_mid +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/bypass_pulse_cond +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_pulse_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/spitting_enable +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/spit_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/seq_bus_valid +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/spit_nco_msb +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_apply_corr_en +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_error_meas_avail +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_corr_ready +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_error_meas_started +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/init_wh +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/loc_pd_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_meas_event +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_img_end +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/first_img_started +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_wr_en +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_comp_enable +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_saturation +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_sat_flag +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_apply_corr_en_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_corr_start +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_skip_corr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_img_2nd_half +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_img_2nd_half_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/selected_pulse +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/selected_pulse_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/clr_pd_queue +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/zero_gap_mode +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_image_flag +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abs_pos_msb_old +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_csr_addr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_trigger_in +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_corr_ready_v +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_addr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_width +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_width_ext +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/init_v +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_start_addr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/bpe_top +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_address +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_wr_addr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_addr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_address_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_rotat_cnt +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/overdrive_events +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/overdrive_thres +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pulse_interval +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_loop_filt_tot +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_loop_filt_delta +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_delay +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_delay_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enc_speed_norm_coeff +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_wr_data +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_wr_q +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_comp +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/tof_lut_comp_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enc_speed_meas_w_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/enc_vel_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/img_size +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pixel_cnt +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_vector_out +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_skip_corr_thres +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_img_pixel_cnt +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_image_pixel_len +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/basic_pos_error_sat +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/norm_enc_vel +add wave -noupdate -group CH-0 -radix unsigned /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_offset +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/avs_readdata_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_writedata +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_readdata +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_csr_writedata +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_ctrl_csr_readdata +add wave -noupdate -group CH-0 -radix unsigned /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_offset_dir0 +add wave -noupdate -group CH-0 -radix unsigned /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/ch_offset_dir1 +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abs_pos_max +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abs_pos_min +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/last_pd_pos +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/basic_pos_error +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pd_in_cnt +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/fire_req_cnt +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/seq_bus_data +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/spit_nco +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/spit_nco_inc +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/start_pos +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/abs_pos_d +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err_2_corr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err_max +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err_min +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err_curr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err_old +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_pos_err_abs +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_tot_err +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_delta_err +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_offset +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_ratio +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_ratio_i +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_ratio_corr +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_ratio_corr_new +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_loop_err_delta +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_loop_err_tot +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/pos_error +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/wh_loop_err +add wave -noupdate -group CH-0 /fire_pulse_manager_5_tb/iDUT/pulse_generator_g(1)/iCH_PG/div_ratio_corr_ext +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/reset_n +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/clk +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_in +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/inc_pos +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/dec_pos +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/abs_position +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/tx_data +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/avs_address +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/avs_write +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/avs_writedata +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/avs_read +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/avs_readdatavalid +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/avs_readdata +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/rd_event +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/wr_event +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/empty +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/full +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/tx_ready +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/rd_event_d +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/wr_event_i +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/symbol_valid +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/enable +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/toggle_sync +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/toggle_pd +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/add_keepalive +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/ovfl_err +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init_d +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init_gen +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/clear +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_in_d +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_gen +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/parity_bit +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/inject_error +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/inject_error_req +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_event +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_event_d +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_event_dd +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init_blocked +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/pd_event_ddd +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/delayed_pos +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/clr_fifo_lmax +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/delayed_pos_v +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init_v +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/gray +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/bit_div +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/latched_pos +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/event_in_i +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/event_in +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/event_out +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/symbol +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init_blk_cnt +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/keepalive_cnt +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/keepalive_period +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/init_blocked_period +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/fifo_level +add wave -noupdate -group POF_Tx /fire_pulse_manager_5_tb/iPOF_TX/fifo_level_max +TreeUpdate [SetDefaultTree] +WaveRestoreCursors {{Cursor 1} {16135000 ps} 0} +quietly wave cursor active 1 +configure wave -namecolwidth 223 +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 ps +update +WaveRestoreZoom {0 ps} {193574912 ps} diff --git a/generic_ip/fire_pulse_manager/5/src/fire_pulse_5_pkg.vhd b/generic_ip/fire_pulse_manager/5/src/fire_pulse_5_pkg.vhd new file mode 100644 index 0000000..ac8d897 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/fire_pulse_5_pkg.vhd @@ -0,0 +1,37 @@ +------------------------------------------------------------------------------- +-- Title : fire_pulse_pkg +-- Project : HMB/EMB/SMB +------------------------------------------------------------------------------- +-- File : fire_pulse_pkg.vhd +-- Author : Gianmarco Girau +-- Company : Global Inkjet Systems +-- Created : 2017-09-08 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'08 +------------------------------------------------------------------------------- +-- Description: +-- Package for fire_pulse_manager block +------------------------------------------------------------------------------- +-- altera vhdl_input_version vhdl_2008 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +package fire_pulse_5_pkg is + + ----------------------------------------------------------------------------- + -- Inner block mapping + ----------------------------------------------------------------------------- + + constant blk_num : integer := 8; -- number of sub-blocks with dedicated + -- C&S registers + + constant fp_ctrl_id : natural := 0; -- Block ID for the Fire-Pulse-Mang Controller + constant diag_blk_id : natural := 1; -- Block ID for the Diagnostic Block + constant log_blk_id : natural := 2; -- Block ID for the Event Logger + constant int_enc_id : natural := 3; -- Block ID for the Internal Encoder Block + constant pg_ch_id : natural := 4; -- Block ID for Pulse-Generator + +end package fire_pulse_5_pkg; diff --git a/generic_ip/fire_pulse_manager/5/src/fire_pulse_ctrl_5.vhd b/generic_ip/fire_pulse_manager/5/src/fire_pulse_ctrl_5.vhd new file mode 100644 index 0000000..2d8e6dc --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/fire_pulse_ctrl_5.vhd @@ -0,0 +1,276 @@ +------------------------------------------------------------------------------- +-- Title : fire_pulse_ctrl +-- Project : HMB/EMB/SMB +------------------------------------------------------------------------------- +-- File : fire_pulse_ctrl.vhd +-- Author : Gianmarco Girau +-- Company : Global Inkjet Systems +-- Created : 2017-09-06 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'08 +------------------------------------------------------------------------------- +-- Description: +-- Control service logic for the Fire-Controller-Manager +------------------------------------------------------------------------------- +-- altera vhdl_input_version vhdl_2008 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity fire_pulse_ctrl_5 is + port( + reset_n : in std_logic; + clk : in std_logic; + src_sel : out std_logic_vector(1 downto 0); + uart_regen_bypass : out std_logic; + upd_max_pos : out std_logic; + upd_min_pos : out std_logic; + enable_rx : out std_logic; + uart_bit_div : out std_logic_vector(3 downto 0); + error_rate_thres : out std_logic_vector(7 downto 0); + max_error_flag : in std_logic; + rx_watchdog : in std_logic; + rx_watchdog_en : out std_logic; + rx_watchdog_clr : out std_logic; + parity_err_cnt : in std_logic_vector(15 downto 0); + skip_pos_cnt : in std_logic_vector(15 downto 0); + mon_point_src : in std_logic_vector(15 downto 0); + mon_points : out std_logic_vector(3 downto 0); + coarse_time : out std_logic_vector(31 downto 0); + fine_time : out std_logic_vector(27 downto 0); + one_pps : out std_logic; + ext_fp_det : out std_logic_vector(15 downto 0); + ext_fp_gen : out std_logic_vector(15 downto 0); + -- Interrupt Senders + ins_fpm_irq_0 : out std_logic; + -- Avalon MM Interface + avs_address : in std_logic_vector(3 downto 0); + avs_write : in std_logic; + avs_writedata : in std_logic_vector(31 downto 0); + avs_read : in std_logic; + avs_readdatavalid : out std_logic; + avs_readdata : out std_logic_vector(31 downto 0)); +end entity fire_pulse_ctrl_5; + +architecture rtl of fire_pulse_ctrl_5 is + + ----------------------------------------------------------------------------- + -- Control & Status Registers Map + ----------------------------------------------------------------------------- + constant CSR_IP_ID : std_logic_vector(31 downto 0) := x"0000FF14"; + constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000400"; + + constant CSR_IP_ID_REG : std_logic_vector(3 downto 0) := b"0000"; + constant CSR_IP_VER_REG : std_logic_vector(3 downto 0) := b"0001"; + constant SRC_SEL_REG : std_logic_vector(3 downto 0) := b"0010"; + constant POF_RX_CTRL : std_logic_vector(3 downto 0) := b"0011"; + constant MON_PT_CTRL_REG : std_logic_vector(3 downto 0) := b"0100"; + constant COARSE_TIME_INIT_REG : std_logic_vector(3 downto 0) := b"0101"; + constant FINE_TIME_INIT_REG : std_logic_vector(3 downto 0) := b"0110"; + constant FINE_TIME_REG : std_logic_vector(3 downto 0) := b"0111"; + constant COARSE_TIME_REG : std_logic_vector(3 downto 0) := b"1000"; + constant RX_ERROR_STATUS : std_logic_vector(3 downto 0) := b"1001"; + constant RX_ERROR_CSR : std_logic_vector(3 downto 0) := b"1010"; + constant IRQ_MNG_REG : std_logic_vector(3 downto 0) := b"1011"; + constant EXT_FP_CTRL_REG : std_logic_vector(3 downto 0) := b"1100"; + + ----------------------------------------------------------------------------- + -- Constants, Signals + ----------------------------------------------------------------------------- + + constant FINE_TIME_TC : integer := 100000000 - 1; -- clk must be 100MHz to + -- make it right + + signal enable_rx_i : std_logic; + signal fine_time_wrap, time_ld_en : std_logic; + signal rx_watchdog_en_i, rx_watchdog_clr_i : std_logic; + signal uart_regen_bypass_i : std_logic; + signal upd_min_pos_i, upd_max_pos_i : std_logic; + signal irq, irq_src, irq_src_d : std_logic_vector(0 downto 0); + signal irq_en, irq_mask, irq_val, irq_clr : std_logic_vector(0 downto 0); + signal src_sel_i : std_logic_vector(1 downto 0); + signal mp_sel0, mp_sel1, mp_sel2, mp_sel3 : std_logic_vector(3 downto 0); + signal bit_div : std_logic_vector(3 downto 0); + signal error_rate_thres_i : std_logic_vector(7 downto 0); + signal fine_time_init, fine_time_i : std_logic_vector(27 downto 0); + signal coarse_time_init, coarse_time_i : std_logic_vector(31 downto 0); + signal ext_fp_det_i, ext_fp_gen_i : std_logic_vector(15 downto 0); + +begin + + pCTRL_REGs : process(reset_n, clk) + begin -- process + if (reset_n = '0') then + fine_time_i <= (others => '0'); + coarse_time_i <= (others => '0'); + elsif (clk = '1' and clk'event) then + if (time_ld_en = '1') then + fine_time_i <= fine_time_init; + elsif (fine_time_wrap = '1') then + fine_time_i <= (others => '0'); + else + fine_time_i <= std_logic_vector(unsigned(fine_time_i) + 1); + end if; + if (time_ld_en = '1') then + coarse_time_i <= coarse_time_init; + elsif (fine_time_wrap = '1') then + coarse_time_i <= std_logic_vector(unsigned(coarse_time_i) + 1); + end if; + one_pps <= fine_time_wrap; + end if; + end process pCTRL_REGs; + + fine_time_wrap <= '1' when unsigned(fine_time_i) = FINE_TIME_TC else '0'; + + coarse_time <= coarse_time_i; + fine_time <= fine_time_i; + + -- MOnitoring Point selection + mon_points(0) <= mon_point_src(to_integer(unsigned(mp_sel0))); + mon_points(1) <= mon_point_src(to_integer(unsigned(mp_sel1))); + mon_points(2) <= mon_point_src(to_integer(unsigned(mp_sel2))); + mon_points(3) <= mon_point_src(to_integer(unsigned(mp_sel3))); + + ----------------------------------------------------------------------------- + -- IRQ generation and management + ----------------------------------------------------------------------------- + + pIRQ : process(reset_n, clk) + begin + if (reset_n = '0') then + ins_fpm_irq_0 <= '0'; + irq <= "0"; + irq_src_d <= "0"; + elsif (clk = '1' and clk'event) then + irq_src_d <= irq_src; + for n in 0 to irq'left loop + if (irq_clr(n) = '1') then + irq(n) <= '0'; + elsif (irq_en(n) = '1' and irq_src(n) = '1' and irq_src_d(n) = '0') then + irq(n) <= '1'; + end if; + end loop; -- n + ins_fpm_irq_0 <= irq_val(0); + end if; + end process pIRQ; + + irq_val <= irq and not irq_mask; + irq_src <= "1" when max_error_flag = '1' or rx_watchdog = '1' else "0"; + + ----------------------------------------------------------------------------- + -- C&S registers + ----------------------------------------------------------------------------- + + src_sel <= src_sel_i; + enable_rx <= enable_rx_i; + uart_regen_bypass <= uart_regen_bypass_i; + + uart_bit_div <= bit_div; + upd_max_pos <= upd_max_pos_i; + upd_min_pos <= upd_min_pos_i; + + error_rate_thres <= error_rate_thres_i; + rx_watchdog_en <= rx_watchdog_en_i; + rx_watchdog_clr <= rx_watchdog_clr_i; + + ext_fp_det <= ext_fp_det_i; + ext_fp_gen <= ext_fp_gen_i; + + pCTRL_STATUS : process(reset_n, clk) + begin + if (reset_n = '0') then + avs_readdatavalid <= '0'; + src_sel_i <= "00"; + enable_rx_i <= '0'; + uart_regen_bypass_i <= '0'; + upd_max_pos_i <= '0'; + upd_min_pos_i <= '0'; + bit_div <= "0100"; + error_rate_thres_i <= X"0A"; + rx_watchdog_en_i <= '1'; + rx_watchdog_clr_i <= '0'; + mp_sel0 <= X"0"; + mp_sel1 <= X"0"; + mp_sel2 <= X"0"; + mp_sel3 <= X"0"; + coarse_time_init <= (others => '0'); + fine_time_init <= (others => '0'); + time_ld_en <= '0'; + ext_fp_det_i <= X"0010"; + ext_fp_gen_i <= X"0020"; + elsif (clk = '1' and clk'event) then + -- CTRL registers + if (avs_write = '1') then + case avs_address is + when SRC_SEL_REG => + src_sel_i <= avs_writedata(1 downto 0); + when POF_RX_CTRL => + enable_rx_i <= avs_writedata(0); + uart_regen_bypass_i <= avs_writedata(1); + upd_max_pos_i <= avs_writedata(2); + upd_min_pos_i <= avs_writedata(3); + bit_div <= avs_writedata(7 downto 4); + when MON_PT_CTRL_REG => + mp_sel0 <= avs_writedata(3 downto 0); + mp_sel1 <= avs_writedata(7 downto 4); + mp_sel2 <= avs_writedata(11 downto 8); + mp_sel3 <= avs_writedata(15 downto 12); + when COARSE_TIME_INIT_REG => + coarse_time_init <= avs_writedata; + when FINE_TIME_INIT_REG => + time_ld_en <= avs_writedata(28); + fine_time_init <= avs_writedata(27 downto 0); + when RX_ERROR_CSR => + error_rate_thres_i <= avs_writedata(7 downto 0); + rx_watchdog_en_i <= avs_writedata(8); + rx_watchdog_clr_i <= avs_writedata(9); + when IRQ_MNG_REG => + irq_en <= avs_writedata(0 downto 0); + irq_clr <= avs_writedata(4 downto 4); + irq_mask <= avs_writedata(8 downto 8); + when EXT_FP_CTRL_REG => + ext_fp_det_i <= avs_writedata(15 downto 0); + ext_fp_gen_i <= avs_writedata(31 downto 16); + when others => null; + end case; + end if; + -- Read Ctrl & Status registers + avs_readdatavalid <= avs_read; + if (avs_read = '1') then + case avs_address is + when CSR_IP_ID_REG => + avs_readdata <= CSR_IP_ID; + when CSR_IP_VER_REG => + avs_readdata <= CSR_IP_VER; + when SRC_SEL_REG => + avs_readdata <= (0 => src_sel_i(0), 1 => src_sel_i(1), others => '0'); + when POF_RX_CTRL => + avs_readdata <= X"000000" & bit_div & upd_min_pos_i & upd_max_pos_i & uart_regen_bypass_i & enable_rx_i; + when MON_PT_CTRL_REG => + avs_readdata <= X"0000" & mp_sel3 & mp_sel2 & mp_sel1 & mp_sel0; + when COARSE_TIME_INIT_REG => + avs_readdata <= coarse_time_init; + when FINE_TIME_INIT_REG => + avs_readdata <= b"000" & time_ld_en & fine_time_init; + when RX_ERROR_STATUS => + avs_readdata <= skip_pos_cnt & parity_err_cnt; + when FINE_TIME_REG => + avs_readdata <= X"0" & fine_time_i; + when COARSE_TIME_REG => + avs_readdata <= coarse_time_i; + when RX_ERROR_CSR => + avs_readdata <= X"00000" & max_error_flag & rx_watchdog & rx_watchdog_clr_i & rx_watchdog_en_i & error_rate_thres_i; + when IRQ_MNG_REG => + avs_readdata <= X"0000" & "000" & irq_val & "000" & irq_mask & "000" & irq_clr & "000" & irq_en; + when EXT_FP_CTRL_REG => + avs_readdata <= ext_fp_gen_i & ext_fp_det_i; + when others => + avs_readdata <= X"BAD1BAD0"; + end case; + end if; + end if; + end process pCTRL_STATUS; + +end architecture rtl; diff --git a/generic_ip/fire_pulse_manager/5/src/fire_pulse_ext_5.vhd b/generic_ip/fire_pulse_manager/5/src/fire_pulse_ext_5.vhd new file mode 100644 index 0000000..ba724b8 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/fire_pulse_ext_5.vhd @@ -0,0 +1,108 @@ +------------------------------------------------------------------------------- +-- Title : fire_pulse_manager +-- Project : GMA +------------------------------------------------------------------------------- +-- File : fire_pulse_ext.vhd +-- Author : Christos Spirotis +-- Company : Global Inkjet Systems +-- Created : 2017-10-03 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'08 +------------------------------------------------------------------------------- +-- Description: +-- Detects external fire pulse and regenerates it +------------------------------------------------------------------------------- +-- altera vhdl_input_version vhdl_2008 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +library work; + +entity fire_pulse_ext_5 is + port( + reset_n : in std_logic; + clk : in std_logic; -- 100MHz + + ext_fp_det : in std_logic_vector(15 downto 0); + ext_fp_gen : in std_logic_vector(15 downto 0); + + ext_in : in std_logic; + ext_out : out std_logic + ); +end entity fire_pulse_ext_5; + +architecture rtl of fire_pulse_ext_5 is + +signal ext_in_cnt : unsigned(15 downto 0); +signal ext_out_cnt : unsigned(15 downto 0); +signal ext_in_det : std_logic_vector( 2 downto 0); +signal fp_gen : std_logic; + +begin + + -- Detect pulse + pulse_det : process (clk, reset_n) + begin + if (reset_n = '0') then + ext_in_cnt <= (others => '0'); + ext_in_det <= (others => '0'); + fp_gen <= '0'; + elsif rising_edge(clk) then + fp_gen <= '0'; + ext_in_det <= ext_in_det(1 downto 0) & ext_in; + + -- Detect rising edge while idle + if (ext_in_det(2 downto 1) = "01" and ext_in_cnt = 0) then + -- Start width counter + ext_in_cnt <= X"0001"; + -- Measure width while signal high + elsif ext_in_cnt /= 0 and ext_in_det(1) = '1' then + -- Counter++ + ext_in_cnt <= ext_in_cnt + 1; + -- If reached minimum width + if ext_in_cnt >= unsigned(ext_fp_det) then + -- Regenerate pulse + fp_gen <= '1'; + -- Reset width counter + ext_in_cnt <= (others => '0'); + end if; + -- If signal drops before detection + elsif ext_in_cnt /= 0 and ext_in_det(1) = '0' then + -- Reset width counter + ext_in_cnt <= (others => '0'); + end if; + end if; + end process pulse_det; + + -- Regenerate pulse + pulse_regen : process (clk, reset_n) + begin + if (reset_n = '0') then + ext_out_cnt <= (others => '0'); + ext_out <= '0'; + elsif rising_edge(clk) then + -- Look for pulse detected + if fp_gen = '1' and ext_out_cnt = 0 then + -- Start width counter + ext_out_cnt <= X"0001"; + -- Generate pulse + ext_out <= '1'; + -- If counting + elsif ext_out_cnt /= 0 then + -- Increment width + ext_out_cnt <= ext_out_cnt + 1; + -- If width reached programmed value + if ext_out_cnt >= unsigned(ext_fp_gen) then + -- Reset pulse + ext_out <= '0'; + -- Reset width counter + ext_out_cnt <= (others => '0'); + end if; + end if; + end if; + end process pulse_regen; + +end architecture rtl; diff --git a/generic_ip/fire_pulse_manager/5/src/fire_pulse_manager_5.vhd b/generic_ip/fire_pulse_manager/5/src/fire_pulse_manager_5.vhd new file mode 100644 index 0000000..44c4d72 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/fire_pulse_manager_5.vhd @@ -0,0 +1,622 @@ +------------------------------------------------------------------------------- +-- Title : fire_pulse_manager +-- Project : HMB/EMB/SMB +------------------------------------------------------------------------------- +-- File : fire_pulse_manager.vhd +-- Author : Gianmarco Girau +-- Company : Global Inkjet Systems +-- Created : 2017-09-06 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'08 +------------------------------------------------------------------------------- +-- Description: +-- Generates fire request from the EMS output data +------------------------------------------------------------------------------- +-- altera vhdl_input_version vhdl_2008 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +use work.fire_pulse_5_pkg.all; + +entity fire_pulse_manager_5 is + generic ( + CH_NUM : integer := 4; -- number of Pulse-Generator blocks + PD_QUEUE_SIZE : natural := 512; + ADD_SMB_DIAG : boolean := false; -- Instantiate SMB Diagnostic block + ADD_EVENT_LOGGER : boolean := false; -- Instantiate Event-Logger block + LOG_FIFO_SIZE : natural range 256 to 4096 := 1024; + POF_PROT_VER : natural range 0 to 1 := 0; -- POF-Protocol Versions: + -- 0 => Standard, 1 => Add Print-Start + PULSE_DELAY_EQUAL_EN : boolean := false; + TOF_COMP_EN : boolean := false; + PIXEL_PITCH_CORR_EN : boolean := false; + OUT_PULSE_CONDITION : boolean := true); + port( + reset_n : in std_logic; + clk : in std_logic; -- 100MHz + rx_clk : in std_logic; -- 300MHz (typical) + -- Datapath I/Os + pof_rx : in std_logic; + pof_tx : out std_logic; + pof_iso_en : out std_logic; + fire_pulse : out std_logic_vector(ch_num - 1 downto 0); + start_of_image : out std_logic_vector(ch_num - 1 downto 0); + abs_pos_out : out std_logic_vector(31 downto 0); + print_start : out std_logic; + mon_pt : out std_logic_vector(3 downto 0); -- Monitoring Points + -- on header J7 + -- Interrupt Senders + ins_fpm_irq_0 : out std_logic; + ins_fpm_irq_1 : out std_logic; -- @suppress "Unused port: ins_fpm_irq_1 is not used in work.fire_pulse_manager_5(rtl)" + ins_fpm_irq_2 : out std_logic; -- @suppress "Unused port: ins_fpm_irq_2 is not used in work.fire_pulse_manager_5(rtl)" + ins_fpm_irq_3 : out std_logic; -- @suppress "Unused port: ins_fpm_irq_3 is not used in work.fire_pulse_manager_5(rtl)" + -- Avalon MM (Slave) Interface + avs_address : in std_logic_vector(14 downto 0); + avs_write : in std_logic; + avs_writedata : in std_logic_vector(31 downto 0); + avs_read : in std_logic; + avs_waitrequest : out std_logic; + avs_readdata : out std_logic_vector(31 downto 0)); +end entity fire_pulse_manager_5; + +architecture rtl of fire_pulse_manager_5 is + + -- Period used for Time-of-Flight compensation velocity measurememnt + constant VEL_MEAS_PERIOD : natural := 10000; + + constant POF_UART_BIT_BIV : integer := 6; -- POF-Rx UART sampling clock vs + -- baudrate ratio + + type diag_cnt_en_t is array (0 to CH_NUM-1) of boolean; + constant DIAG_COUNTER_EN : diag_cnt_en_t := (0 => true, others => false); + + signal reset_n_i : std_logic; + -- + signal cs_addr : std_logic_vector(10 downto 0); + signal cs_write_en : std_logic_vector(blk_num - 1 downto 0); + signal cs_write_data : std_logic_vector(31 downto 0); + signal cs_read_en : std_logic_vector(blk_num - 1 downto 0); + signal cs_read_valid : std_logic_vector(blk_num - 1 downto 0); + signal cs_read_data : std_logic_vector(32 * blk_num - 1 downto 0); + -- + signal cs_ctrl_write_en : std_logic; + signal cs_ctrl_read_en : std_logic; + signal cs_ctrl_read_valid : std_logic; + signal cs_ctrl_read_data : std_logic_vector(31 downto 0); + -- + signal cs_pg_write_en : std_logic_vector(CH_NUM - 1 downto 0); + signal cs_pg_read_en : std_logic_vector(CH_NUM - 1 downto 0); + signal cs_pg_read_valid : std_logic_vector(CH_NUM - 1 downto 0); + signal cs_pg_read_data : std_logic_vector(32 * CH_NUM - 1 downto 0); + -- + signal cs_diag_write_en : std_logic; + signal cs_diag_read_en : std_logic; + signal cs_diag_read_valid : std_logic; + signal cs_diag_read_data : std_logic_vector(31 downto 0); + -- + signal cs_log_write_en : std_logic; + signal cs_log_read_en : std_logic; + signal cs_log_read_valid : std_logic; + signal cs_log_read_data : std_logic_vector(31 downto 0); + -- + signal cs_ie_write_en : std_logic; + signal cs_ie_read_en : std_logic; + signal cs_ie_read_valid : std_logic; + signal cs_ie_read_data : std_logic_vector(31 downto 0); + -- + signal enable_rx : std_logic; + signal uart_regen_bypass : std_logic; + signal max_error_flag : std_logic; + signal rx_watchdog : std_logic; + signal rx_watchdog_en : std_logic; + signal rx_watchdog_clr : std_logic; + signal print_start_i : std_logic; + signal error_rate_thres : std_logic_vector(7 downto 0); + signal parity_err_cnt : std_logic_vector(15 downto 0); + signal skip_pos_cnt : std_logic_vector(15 downto 0); + signal mon_point_src : std_logic_vector(15 downto 0); + signal fine_time : std_logic_vector(27 downto 0); + signal coarse_time : std_logic_vector(31 downto 0); + -- + signal init, remote_init : std_logic; + signal dp_dir : std_logic_vector(CH_NUM - 1 downto 0); + signal set_pos_ie : std_logic; + signal enc_pulse : std_logic_vector(CH_NUM - 1 downto 0); + signal pd_pulse : std_logic; + signal pd_pulse_ie : std_logic; + signal pd_pulse_pof : std_logic; + signal inc_pos : std_logic; + signal inc_pos_pof : std_logic; + signal inc_pos_ie : std_logic; + signal dec_pos : std_logic; + signal dec_pos_pof : std_logic; + signal dec_pos_ie : std_logic; + signal abs_pos : std_logic_vector(31 downto 0); + signal abs_pos_pof : std_logic_vector(31 downto 0); + signal abs_pos_ie : std_logic_vector(39 downto 0); + -- + signal ch_pd, ch_pulse_out : std_logic_vector(CH_NUM - 1 downto 0); + signal ch_raw_pulse, ch_mask : std_logic_vector(CH_NUM - 1 downto 0); + signal ch_start_of_image : std_logic_vector(CH_NUM - 1 downto 0); + signal start_of_image_i : std_logic_vector(CH_NUM - 1 downto 0); + signal fire_pulse_i : std_logic_vector(CH_NUM - 1 downto 0); + signal src_sel : std_logic_vector(1 downto 0); + -- + type vel_samp_per_vec_t is array (0 to CH_NUM-1) of std_logic_vector(19 downto 0); + signal vel_meas : std_logic_vector(19 downto 0); + signal vel_sampling_per : vel_samp_per_vec_t; + -- + signal one_pps : std_logic; + signal ext_fp_det : std_logic_vector(15 downto 0); + signal ext_fp_gen : std_logic_vector(15 downto 0); + signal pof_rx_regen : std_logic; + signal log_data_src : std_logic_vector(31 downto 0); + +begin + + ----------------------------------------------------------------------------- + -- Synchronize the input reset (h2f_reset) to the clock (from PLL) + ----------------------------------------------------------------------------- + + iSyncReset : entity work.sync_reset + port map( + async_rstN => reset_n, + clk => clk, + sync_rstN => reset_n_i); + + + ----------------------------------------------------------------------------- + -- C&S Register Interface Splitting + ----------------------------------------------------------------------------- + + iCS_BUS_ITF : entity work.cs_bus_ift + generic map( + blk_num => blk_num) + port map( + rstN => reset_n_i, + clk => clk, + avs_address => avs_address(14 downto 0), + avs_write => avs_write, + avs_writedata => avs_writedata, + avs_read => avs_read, + avs_waitrequest => avs_waitrequest, + avs_readdata => avs_readdata, + cs_addr => cs_addr, + cs_we => cs_write_en, + cs_wr_data => cs_write_data, + cs_re => cs_read_en, + cs_rv => cs_read_valid, + cs_rd_data => cs_read_data); + + cs_ctrl_write_en <= cs_write_en(fp_ctrl_id); + cs_diag_write_en <= cs_write_en(diag_blk_id); + cs_log_write_en <= cs_write_en(log_blk_id); + cs_ie_write_en <= cs_write_en(int_enc_id); + cs_pg_write_en_g : for i in 1 to CH_NUM generate + cs_pg_write_en(i - 1) <= cs_write_en(pg_ch_id + i - 1); + end generate; + + cs_ctrl_read_en <= cs_read_en(fp_ctrl_id); + cs_diag_read_en <= cs_read_en(diag_blk_id); + cs_log_read_en <= cs_read_en(log_blk_id); + cs_ie_read_en <= cs_read_en(int_enc_id); + cs_pg_read_en_g : for i in 1 to CH_NUM generate + cs_pg_read_en(i - 1) <= cs_read_en(pg_ch_id + i - 1); + end generate; + + cs_read_valid(fp_ctrl_id) <= cs_ctrl_read_valid; + cs_read_valid(diag_blk_id) <= cs_diag_read_valid; + cs_read_valid(log_blk_id) <= cs_log_read_valid; + cs_read_valid(int_enc_id) <= cs_ie_read_valid; + cs_read_valid_pg_g : for i in 1 to CH_NUM generate + cs_read_valid(pg_ch_id + i - 1) <= cs_pg_read_valid(i - 1); + end generate; + + cs_read_data(31 + 32 * fp_ctrl_id downto 32 * fp_ctrl_id) <= cs_ctrl_read_data; + cs_read_data(31 + 32 * diag_blk_id downto 32 * diag_blk_id) <= cs_diag_read_data; + cs_read_data(31 + 32 * log_blk_id downto 32 * log_blk_id) <= cs_log_read_data; + cs_read_data(31 + 32 * int_enc_id downto 32 * int_enc_id) <= cs_ie_read_data; + cs_read_data_pg_g : for i in 1 to CH_NUM generate + cs_read_data(31 + 32 * (pg_ch_id + i - 1) downto 32 * (pg_ch_id + i - 1)) <= cs_pg_read_data(31 + 32 * (i - 1) downto 32 * (i - 1)); + end generate; + + ----------------------------------------------------------------------------- + -- Fire-Pulse-Manager Controller + ----------------------------------------------------------------------------- + + iCTRL : entity work.fire_pulse_ctrl_5 + port map( + reset_n => reset_n_i, + clk => clk, + src_sel => src_sel, + uart_regen_bypass => uart_regen_bypass, + upd_max_pos => open, + upd_min_pos => open, + enable_rx => enable_rx, + uart_bit_div => open, + error_rate_thres => error_rate_thres, + max_error_flag => max_error_flag, + rx_watchdog => rx_watchdog, + rx_watchdog_en => rx_watchdog_en, + rx_watchdog_clr => rx_watchdog_clr, + parity_err_cnt => parity_err_cnt, + skip_pos_cnt => skip_pos_cnt, + mon_point_src => mon_point_src, + mon_points => mon_pt, + coarse_time => coarse_time, + fine_time => fine_time, + one_pps => one_pps, + ext_fp_det => ext_fp_det, + ext_fp_gen => ext_fp_gen, + ins_fpm_irq_0 => ins_fpm_irq_0, + avs_address => cs_addr(3 downto 0), + avs_write => cs_ctrl_write_en, + avs_writedata => cs_write_data, + avs_read => cs_ctrl_read_en, + avs_readdatavalid => cs_ctrl_read_valid, + avs_readdata => cs_ctrl_read_data); + + ins_fpm_irq_1 <= '0'; + ins_fpm_irq_2 <= '0'; + ins_fpm_irq_3 <= '0'; + + -- Output multiplexer + fire_pulse_i <= ch_pulse_out when src_sel(0) = '1' else (others => pof_rx_regen); + fire_pulse <= fire_pulse_i; + -- The start-of-image for zero-gap is available only when fire-request are + -- generated locally, through the pulse-generator + start_of_image_i <= ch_start_of_image when src_sel(0) = '1' else (others => '0'); + start_of_image <= start_of_image_i; + + pd_pulse <= pd_pulse_pof when src_sel(1) = '0' else pd_pulse_ie; + abs_pos <= abs_pos_pof when src_sel(1) = '0' else abs_pos_ie(31 downto 0); + inc_pos <= inc_pos_pof when src_sel(1) = '0' else inc_pos_ie; + dec_pos <= dec_pos_pof when src_sel(1) = '0' else dec_pos_ie; + + pBUF_ABS_POS : process(clk) + begin + if(clk = '1' and clk'event) then + abs_pos_out <= abs_pos; + end if; + end process pBUF_ABS_POS; + + pINIT_GEN : process(clk) + begin + if(clk = '1' and clk'Event) then + if(src_sel(1) = '0') then + init <= not enable_rx or remote_init; + else + init <= set_pos_ie; + end if; + end if; + end process pINIT_GEN; + + mon_point_src(0) <= init; + mon_point_src(1) <= dp_dir(0); + mon_point_src(2) <= pd_pulse; + mon_point_src(3) <= enc_pulse(0); + mon_point_src(4) <= ch_pd(0); + mon_point_src(5) <= ch_pulse_out(0); + mon_point_src(6) <= ch_raw_pulse(0); + mon_point_src(7) <= ch_mask(0); + mon_point_src(8) <= pof_rx; + mon_point_src(9) <= fire_pulse_i(0); + mon_point_src(10) <= start_of_image_i(0); + mon_point_src(11) <= inc_pos; + mon_point_src(12) <= dec_pos; + mon_point_src(13) <= print_start_i; + -- + mon_point_src(15 downto 14) <= (others => '0'); + + pof_iso_en <= enable_rx; + + ----------------------------------------------------------------------------- + -- Encoder Speed Detection + ----------------------------------------------------------------------------- + + gENC_VEL: if TOF_COMP_EN = true generate + + -- Used for Time-of-Flight Compensation + iVEL : entity work.simple_enc_vel_detect_5 + port map ( + clk => clk, + init => init, + step_pos => inc_pos, + step_neg => dec_pos, + sampling_period => vel_sampling_per(0), + vel_meas => vel_meas); + + else generate + + vel_meas <= (others => '0'); + + end generate gENC_VEL; + + ----------------------------------------------------------------------------- + -- Pulse Generator + ----------------------------------------------------------------------------- + + pulse_generator_g : for i in 1 to CH_NUM generate + iCH_PG : entity work.pulse_generator_2 + generic map( + PD_QUEUE_SIZE => PD_QUEUE_SIZE, + PULSE_DELAY_EQUAL_EN => PULSE_DELAY_EQUAL_EN, + OUT_PULSE_CONDITION => OUT_PULSE_CONDITION, + OVERDRIVE_CHECK => false, + BIDIR_CH_OFFSET_EN => false, + DIAG_COUNTERS => DIAG_COUNTER_EN(i-1), + TOF_COMP_EN => TOF_COMP_EN, + PIXEL_PITCH_CORR_EN => PIXEL_PITCH_CORR_EN) + port map( + clk => clk, + reset_n => reset_n_i, + init => init, + pd_in => pd_pulse, + abs_position => abs_pos, + enc_vel => vel_meas, + enc_speed_meas_w => vel_sampling_per(i - 1), + dp_dir => dp_dir(i - 1), + pulse_out => ch_pulse_out(i - 1), + start_of_image => ch_start_of_image(i - 1), + ch_pd => ch_pd(i - 1), + ch_mask => ch_mask(i - 1), + raw_pulse_out => ch_raw_pulse(i - 1), + enc_pulse => enc_pulse(i -1), + avs_address => cs_addr(10 downto 0), + avs_write => cs_pg_write_en(i - 1), + avs_writedata => cs_write_data, + avs_read => cs_pg_read_en(i - 1), + avs_readdatavalid => cs_pg_read_valid(i - 1), + avs_readdata => cs_pg_read_data(31 + 32 * (i - 1) downto 32 * (i - 1))); + end generate; + + ----------------------------------------------------------------------------- + -- POF Interface + ----------------------------------------------------------------------------- + + gPOF: if POF_PROT_VER = 0 generate + + -- POF Receiver + iPOF_RX : entity work.pof_rx_0 + generic map( + GEN_BIT_DIV => POF_UART_BIT_BIV) + port map( + reset_n => reset_n_i, + clk => clk, + init => '0', + rx_clk => rx_clk, + rx_data => pof_rx, + init_out => remote_init, + pd_out => pd_pulse_pof, + inc_pos => inc_pos_pof, + dec_pos => dec_pos_pof, + abs_pos => abs_pos_pof, + enable => enable_rx, + error_rate_thres => error_rate_thres, + one_pps => one_pps, + max_error_flag => max_error_flag, + rx_watchdog => rx_watchdog, + rx_watchdog_en => rx_watchdog_en, + rx_watchdog_clr => rx_watchdog_clr, + parity_err_cnt => parity_err_cnt, + skip_pos_cnt => skip_pos_cnt); + + -- UART signal regeneration + iUART_REGEN : entity work.pof_uart_regen_0 + generic map( + GEN_BIT_DIV => POF_UART_BIT_BIV, + data_width => 8) + port map( + reset_n => reset_n, + clk => rx_clk, + enable => enable_rx, + bypass_en => uart_regen_bypass, + uart_rx => pof_rx, + uart_tx => pof_tx); + + print_start <= print_start_i; + + print_start_i <= '0'; + + elsif POF_PROT_VER = 1 generate + + -- POF Receiver + iPOF_RX : entity work.pof_rx_1 + generic map( + GEN_BIT_DIV => POF_UART_BIT_BIV) + port map( + reset_n => reset_n_i, + clk => clk, + init => '0', + rx_clk => rx_clk, + rx_data => pof_rx, + init_out => remote_init, + pd_out => pd_pulse_pof, + print_start => print_start_i, + inc_pos => inc_pos_pof, + dec_pos => dec_pos_pof, + abs_pos => abs_pos_pof, + enable => enable_rx, + error_rate_thres => error_rate_thres, + one_pps => one_pps, + max_error_flag => max_error_flag, + rx_watchdog => rx_watchdog, + rx_watchdog_en => rx_watchdog_en, + rx_watchdog_clr => rx_watchdog_clr, + parity_err_cnt => parity_err_cnt, + skip_pos_cnt => skip_pos_cnt); + + print_start <= print_start_i; + + -- UART signal regeneration + iUART_REGEN : entity work.pof_uart_regen_1 + generic map( + GEN_BIT_DIV => POF_UART_BIT_BIV, + data_width => 9) + port map( + reset_n => reset_n, + clk => rx_clk, + enable => enable_rx, + bypass_en => uart_regen_bypass, + uart_rx => pof_rx, + uart_tx => pof_tx); + + end generate gPOF; + + ----------------------------------------------------------------------------- + -- Diagnostic block + ----------------------------------------------------------------------------- + + gDIAG: if ADD_SMB_DIAG = false generate + + pDIAG_RD : process(clk) + begin + if(clk = '1' and clk'event) then + cs_diag_read_valid <= cs_diag_read_en; + end if; + end process pDIAG_RD; + + cs_diag_read_data <= X"DEAD_BEEF"; + + elsif ADD_SMB_DIAG = true generate + + iDiagnostic : entity work.smb_diagnostics_5 + port map( + clk => clk, + reset_n => reset_n_i, + ext_diag_rst => init, + rs422_phase0 => '0', + rs422_phase1 => '0', + rs422_zero_ph => '0', + rs422_prod_det => '0', + ttl_phase0 => '0', + ttl_phase1 => '0', + ttl_zero_ph => '0', + ttl_prod_det => '0', + ttl_prod_det_npn => '0', + filt_phase0 => '0', + filt_phase1 => '0', + filt_zero_ph => '0', + filt_prod_det => pd_pulse, + enc_out => enc_pulse(0), + pd_out => ch_pd(0), + pos_step => inc_pos, + neg_step => dec_pos, + drop_watch => '0', + fire_req => fire_pulse_i(0), + fine_time => fine_time, + coarse_time => coarse_time, + abs_position => open, + ins_diag_irq_0 => ins_fpm_irq_1, + ins_diag_irq_1 => ins_fpm_irq_2, + ins_diag_irq_2 => ins_fpm_irq_3, + avs_address => cs_addr(5 downto 0), + avs_write => cs_diag_write_en, + avs_writedata => cs_write_data, + avs_read => cs_diag_read_en, + avs_readdatavalid => cs_diag_read_valid, + avs_readdata => cs_diag_read_data); + + end generate gDIAG; + + ----------------------------------------------------------------------------- + -- Event Logger + ----------------------------------------------------------------------------- + + gEL: if ADD_EVENT_LOGGER = false generate + + pLOGGER_RD : process(clk) + begin + if(clk = '1' and clk'event) then + cs_log_read_valid <= cs_log_read_en; + end if; + end process pLOGGER_RD; + + cs_log_read_data <= X"DEAD_BEEF"; + + elsif ADD_EVENT_LOGGER = true generate + + event_logger_0_1: entity work.event_logger_0 + generic map ( + FIFO_SIZE => LOG_FIFO_SIZE) + port map ( + rstN => reset_n_i, + clk => clk, + data_src => log_data_src, + fine_time => fine_time, + abs_position => abs_pos, + ins_irq => open, + avs_address => cs_addr(3 downto 0), + avs_write => cs_log_write_en, + avs_writedata => cs_write_data, + avs_read => cs_log_read_en, + avs_readdatavalid => cs_log_read_valid, + avs_readdata => cs_log_read_data); + + log_data_src(0) <= init; + log_data_src(1) <= dp_dir(0); + log_data_src(2) <= pd_pulse; + log_data_src(3) <= enc_pulse(0); + log_data_src(4) <= ch_pd(0); + log_data_src(5) <= ch_pulse_out(0); + log_data_src(6) <= ch_raw_pulse(0); + log_data_src(7) <= ch_mask(0); + log_data_src(8) <= pof_rx; + log_data_src(9) <= fire_pulse_i(0); + log_data_src(10) <= start_of_image_i(0); + log_data_src(11) <= inc_pos; + log_data_src(12) <= dec_pos; + log_data_src(13) <= print_start_i; + -- + log_data_src(31 downto 14) <= (others => '0'); + + end generate gEL; + + ----------------------------------------------------------------------------- + -- Ext fire pulse regen + ----------------------------------------------------------------------------- + + fire_pulse_ext_i : entity work.fire_pulse_ext_5 + port map( + reset_n => reset_n_i, + clk => clk, + + ext_fp_det => ext_fp_det, + ext_fp_gen => ext_fp_gen, + + ext_in => pof_rx, + ext_out => pof_rx_regen); + + ----------------------------------------------------------------------------- + -- Internal encoder generator + ----------------------------------------------------------------------------- + + iEMUL : entity work.enc_pd_emul_1 + generic map( + SEQ_ENABLE => false) + port map( + clk => clk, + reset_n => reset_n_i, + ttl_pd => open, + ttl_enc_p1 => open, + ttl_enc_p2 => open, + ttl_enc_zp => open, + rs422_pd => pd_pulse_ie, + rs422_enc_p1 => open, + rs422_enc_p2 => open, + rs422_enc_zp => open, + abs_pos_out => abs_pos_ie, + set_pos_out => set_pos_ie, + inc_pos_out => inc_pos_ie, + dec_pos_out => dec_pos_ie, + avs_address => cs_addr(9 downto 0), + avs_write => cs_ie_write_en, + avs_writedata => cs_write_data, + avs_read => cs_ie_read_en, + avs_readdatavalid => cs_ie_read_valid, + avs_readdata => cs_ie_read_data); + +end architecture rtl; diff --git a/generic_ip/fire_pulse_manager/5/src/simple_enc_vel_detect_5.vhd b/generic_ip/fire_pulse_manager/5/src/simple_enc_vel_detect_5.vhd new file mode 100644 index 0000000..5443216 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/simple_enc_vel_detect_5.vhd @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------- +-- Title : simple encoder velocity detection +-- Project : project independent +------------------------------------------------------------------------------- +-- File : simple_enc_vel_detect_5.vhd +-- Author : Gianmarco Girau +-- Company : Global Inkjet Systems +-- Created : 2019-06-18 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'2008 +------------------------------------------------------------------------------- +-- Description: +-- This block detects encoder velocity by measuring the balance of encoder +-- positive and negative steps over consecutive sampling periods. +-- The sampling period is supposed to be less than 2 ms +------------------------------------------------------------------------------- +-- altera vhdl_input_version vhdl_2008 + + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity simple_enc_vel_detect_5 is + port ( + clk : in std_logic; -- Must be 100 MHz + init : in std_logic; + step_pos : in std_logic; + step_neg : in std_logic; + sampling_period : in std_logic_vector(19 downto 0); + vel_meas : out std_logic_vector(19 downto 0)); +end simple_enc_vel_detect_5; + +architecture RTL of simple_enc_vel_detect_5 is + + signal init_i, sampling_pulse : std_logic; + + signal sampling_per_cnt : std_logic_vector(19 downto 0); + signal vel_meas_i : std_logic_vector(19 downto 0); + signal vel_meas_sat_pos : std_logic_vector(19 downto 0); + signal vel_meas_sat_neg : std_logic_vector(19 downto 0); + +begin -- RTL + + pVEL_DETECT : process(clk) + begin + if(clk = '1' and clk'event) then + init_i <= init; + if(init_i = '1' or sampling_pulse = '1') then + sampling_per_cnt <= (others => '0'); + else + sampling_per_cnt <= std_logic_vector(unsigned(sampling_per_cnt)+1); + end if; + if(init_i = '1' or sampling_pulse = '1') then + vel_meas_i <= (others => '0'); + elsif(step_pos = '1' and signed(vel_meas_i) < signed(vel_meas_sat_pos)) then + vel_meas_i <= std_logic_vector(signed(vel_meas_i)+1); + elsif(step_neg = '1' and signed(vel_meas_i) > signed(vel_meas_sat_neg)) then + vel_meas_i <= std_logic_vector(signed(vel_meas_i)-1); + end if; + if(init_i = '1') then + vel_meas <= (others => '0'); + elsif(sampling_pulse = '1') then + vel_meas <= vel_meas_i; + end if; + end if; + end process pVEL_DETECT; + + sampling_pulse <= '1' when unsigned(sampling_per_cnt) = unsigned(sampling_period)-1 else '0'; + + -- define positive and negative saturation thresholds + vel_meas_sat_pos <= (vel_meas_i'left => '0', others => '1'); + vel_meas_sat_neg <= (vel_meas_i'left => '1', others => '0'); + +end RTL; diff --git a/generic_ip/fire_pulse_manager/5/src/smb_diagnostics_5.vhd b/generic_ip/fire_pulse_manager/5/src/smb_diagnostics_5.vhd new file mode 100644 index 0000000..7d51919 --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/smb_diagnostics_5.vhd @@ -0,0 +1,702 @@ +------------------------------------------------------------------------------- +-- Title : smb diagnostic block +-- Project : SMB +------------------------------------------------------------------------------- +-- File : smb_diagnostics_5.vhd +-- Author : Gianmarco Girau +-- Company : Global Inkjet Systems +-- Created : 2016-08-02 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'2008 +------------------------------------------------------------------------------- +-- Description: This block includes all the SMB diagnostic functionalities +-- except the event logger. +------------------------------------------------------------------------------- +-- altera vhdl_input_version vhdl_2008 + +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity smb_diagnostics_5 is + port ( + clk : in std_logic; + reset_n : in std_logic := '1'; + -- External sync reset (via daisy-chain) + ext_diag_rst : in std_logic; + -- diagnostic inputs + rs422_phase0 : in std_logic; + rs422_phase1 : in std_logic; + rs422_zero_ph : in std_logic; + rs422_prod_det : in std_logic; + ttl_phase0 : in std_logic; + ttl_phase1 : in std_logic; + ttl_zero_ph : in std_logic; + ttl_prod_det : in std_logic; + ttl_prod_det_npn : in std_logic; + filt_phase0 : in std_logic; + filt_phase1 : in std_logic; + filt_zero_ph : in std_logic; + filt_prod_det : in std_logic; + enc_out : in std_logic; + pd_out : in std_logic; + pos_step : in std_logic; + neg_step : in std_logic; + drop_watch : in std_logic; + fire_req : in std_logic; + -- local timer + fine_time : in std_logic_vector(27 downto 0); + coarse_time : in std_logic_vector(31 downto 0); + -- Absolute Position + abs_position : out std_logic_vector(31 downto 0); + -- Interrupt Senders + ins_diag_irq_0 : out std_logic; + ins_diag_irq_1 : out std_logic; + ins_diag_irq_2 : out std_logic; + -- Avalon MM Interface + avs_address : in std_logic_vector( 5 downto 0); + avs_write : in std_logic; + avs_writedata : in std_logic_vector(31 downto 0); + avs_read : in std_logic; + avs_readdatavalid : out std_logic; + avs_readdata : out std_logic_vector(31 downto 0)); +end entity smb_diagnostics_5; + +architecture rtl of smb_diagnostics_5 is + + constant ADDR_WIDTH : integer := avs_address'length; + + constant DIAG_INIT_REG : std_logic_vector(5 downto 0) := b"000000"; + constant DIAG_IN_STATUS_REG : std_logic_vector(5 downto 0) := b"000001"; + constant PHASE0_CNT_REG : std_logic_vector(5 downto 0) := b"000010"; + constant PHASE1_CNT_REG : std_logic_vector(5 downto 0) := b"000011"; + constant ZERO_PH_CNT_REG : std_logic_vector(5 downto 0) := b"000100"; + constant PD_CNT_REG : std_logic_vector(5 downto 0) := b"000101"; + constant ENC_OUT_CNT_REG : std_logic_vector(5 downto 0) := b"000110"; + constant PD_OUT_CNT_REG : std_logic_vector(5 downto 0) := b"000111"; + constant FIRE_REQ_CNT_REG : std_logic_vector(5 downto 0) := b"001000"; + constant UNUSED_REG_0 : std_logic_vector(5 downto 0) := b"001001"; + constant UNUSED_REG_1 : std_logic_vector(5 downto 0) := b"001010"; + constant UNUSED_REG_2 : std_logic_vector(5 downto 0) := b"001011"; + constant ENC_D_TIME_REG : std_logic_vector(5 downto 0) := b"001100"; + constant ENC_DMIN_TIME_REG : std_logic_vector(5 downto 0) := b"001101"; + constant ENC_DMAX_TIME_REG : std_logic_vector(5 downto 0) := b"001110"; + constant ENC_D_TIME_PREV_REG : std_logic_vector(5 downto 0) := b"001111"; + constant ENC_D_TIME_MEAS_STEP : std_logic_vector(5 downto 0) := b"010000"; + constant POSITION_CNT_REG : std_logic_vector(5 downto 0) := b"010001"; + constant DIR_COUNT_THRES_REG : std_logic_vector(5 downto 0) := b"010010"; + constant DIR_COUNT_REG : std_logic_vector(5 downto 0) := b"010011"; + constant ENC_SAMPL_PER_REG : std_logic_vector(5 downto 0) := b"010100"; + constant ENC_FIFO_CS_REG : std_logic_vector(5 downto 0) := b"010101"; + constant ENC_FIFO_OUT_REG : std_logic_vector(5 downto 0) := b"010110"; + constant PD_FIFO_CS_REG : std_logic_vector(5 downto 0) := b"010111"; + constant PD_FIFO_OUT_REG : std_logic_vector(5 downto 0) := b"011000"; + constant PD_WATCH_DOG_CTRL : std_logic_vector(5 downto 0) := b"011001"; + constant PD_WATCH_DOG_THRES : std_logic_vector(5 downto 0) := b"011010"; + constant IRQ_MNG_REG : std_logic_vector(5 downto 0) := b"011011"; + + -- signals + type fsm_status_t is (idle, wait_ph1_ris, wait_ph0_ris); + signal fsm_status_curr,fsm_status_next : fsm_status_t; + -- + signal filt_phase0_d, filt_phase1_d, filt_zero_ph_d, filt_prod_det_d : std_logic; + signal enc_out_d, pd_out_d, filt_phase0_p, filt_phase1_p, init_i : std_logic; + signal filt_zero_ph_p, filt_prod_det_p, enc_out_p, pd_out_p : std_logic; + signal init, rst_counters_i, rst_counters, rst_measur_i, rst_measur : std_logic; + signal rst_dir, rst_dir_i, enable_diff_measur, meas_enc_p : std_logic; + signal ph0_rising, ph0_falling, ph1_rising, ph1_falling : std_logic; + signal set_dir_forward, set_dir_backward, dir_pos_sat, dir_neg_sat : std_logic; + signal direction, direction_d, direction_change : std_logic; + signal sampling_time, fifo_rd_en, fifo_wr_en, fifo_full, fifo_error : std_logic; + signal rst_fifo_i, rst_fifo, rst_pos, rst_pos_i, avs_read_i : std_logic; + signal pd_fifo_error, pd_fifo_wr_en, pd_fifo_rd_en, pd_fifo_full : std_logic; + signal pd_p, pd_log_src, pd_fifo_alarm, enc_fifo_alarm : std_logic; + signal clr_pd_pos, pd_wd_en, pd_wd_alarm, rst_pd_fifo, rst_pd_fifo_i : std_logic; + signal fire_req_d, fire_req_p : std_logic; + -- + signal enable_diff_measur_cnt : std_logic_vector( 1 downto 0); + signal irq_en, irq_clr, irq_src, irq_src_d : std_logic_vector( 2 downto 0); + signal irq, irq_val, irq_mask, pd_data_sel : std_logic_vector( 2 downto 0); + signal meas_enc_pulse : std_logic_vector( 3 downto 0); + signal pd_fifo_usedw, pd_fifo_thres : std_logic_vector( 7 downto 0); + signal fifo_thres, fifo_usedw : std_logic_vector( 9 downto 0); + signal dir_cnt, dir_change_cnt : std_logic_vector(15 downto 0); + signal pos_dir_thres, neg_dir_thres : std_logic_vector(15 downto 0); + signal meas_pulse_cnt, meas_step : std_logic_vector(15 downto 0); + signal input_status : std_logic_vector(16 downto 0); + signal sampling_period, sampling_time_cnt : std_logic_vector(27 downto 0); + signal fine_time_l : std_logic_vector(27 downto 0); + signal filt_phase0_cnt, filt_phase1_cnt : std_logic_vector(31 downto 0); + signal filt_zero_ph_cnt, filt_prod_det_cnt : std_logic_vector(31 downto 0); + signal enc_out_cnt, pd_out_cnt : std_logic_vector(31 downto 0); + signal enc_delta_time, enc_delta_time_prev : std_logic_vector(31 downto 0); + signal enc_delta_time_cnt : std_logic_vector(31 downto 0); + signal enc_delta_time_min, enc_delta_time_max : std_logic_vector(31 downto 0); + signal fifo_d, fifo_q, pos_cnt : std_logic_vector(31 downto 0); + signal pd_fifo_d, pd_fifo_q : std_logic_vector(31 downto 0); + signal pd_pos, coarse_time_l, pd_wd_thres : std_logic_vector(31 downto 0); + signal pd_delta_pos, pd_delta_pos_abs : std_logic_vector(31 downto 0); + signal fire_req_cnt : std_logic_vector(31 downto 0); + + +begin + + pInit : process(clk) + begin + if(clk = '1' and clk'event) then + init <= init_i or ext_diag_rst; + end if; + end process pInit; + + ----------------------------------------------------------------------------- + -- Input Status + ----------------------------------------------------------------------------- + + pInputStatus : process(clk) + begin + if(clk = '1' and clk'event) then + input_status( 0) <= rs422_phase0; + input_status( 1) <= rs422_phase1; + input_status( 2) <= rs422_zero_ph; + input_status( 3) <= rs422_prod_det; + input_status( 4) <= ttl_phase0; + input_status( 5) <= ttl_phase1; + input_status( 6) <= ttl_zero_ph; + input_status( 7) <= ttl_prod_det; + input_status( 8) <= ttl_prod_det_npn; + input_status( 9) <= filt_phase0; + input_status(10) <= filt_phase1; + input_status(11) <= filt_zero_ph; + input_status(12) <= filt_prod_det; + input_status(13) <= enc_out; + input_status(14) <= pd_out; + input_status(15) <= drop_watch; + input_status(16) <= fire_req; + end if; + end process pInputStatus; + + ----------------------------------------------------------------------------- + -- Edge detection and counting + ----------------------------------------------------------------------------- + + pEdgeDetect_Cnt : process(clk) + begin + if(clk = '1' and clk'event) then + filt_phase0_d <= filt_phase0; + filt_phase1_d <= filt_phase1; + filt_zero_ph_d <= filt_zero_ph; + filt_prod_det_d <= filt_prod_det; + enc_out_d <= enc_out; + pd_out_d <= pd_out; + fire_req_d <= fire_req; + if(rst_counters = '1') then + filt_phase0_cnt <= (others => '0'); + elsif(filt_phase0_p = '1') then + filt_phase0_cnt <= std_logic_vector(unsigned(filt_phase0_cnt)+1); + end if; + if(rst_counters = '1') then + filt_phase1_cnt <= (others => '0'); + elsif(filt_phase1_p = '1') then + filt_phase1_cnt <= std_logic_vector(unsigned(filt_phase1_cnt)+1); + end if; + if(rst_counters = '1') then + filt_zero_ph_cnt <= (others => '0'); + elsif(filt_zero_ph_p = '1') then + filt_zero_ph_cnt <= std_logic_vector(unsigned(filt_zero_ph_cnt)+1); + end if; + if(rst_counters = '1') then + filt_prod_det_cnt <= (others => '0'); + elsif(filt_prod_det_p = '1') then + filt_prod_det_cnt <= std_logic_vector(unsigned(filt_prod_det_cnt)+1); + end if; + if(rst_counters = '1') then + enc_out_cnt <= (others => '0'); + elsif(enc_out_p = '1') then + enc_out_cnt <= std_logic_vector(unsigned(enc_out_cnt)+1); + end if; + if(rst_counters = '1') then + pd_out_cnt <= (others => '0'); + elsif(pd_out_p = '1') then + pd_out_cnt <= std_logic_vector(unsigned(pd_out_cnt)+1); + end if; + if(rst_counters = '1') then + fire_req_cnt <= (others => '0'); + elsif(fire_req_p = '1') then + fire_req_cnt <= std_logic_vector(unsigned(fire_req_cnt)+1); + end if; + end if; + end process pEdgeDetect_Cnt; + + filt_phase0_p <= filt_phase0 and not filt_phase0_d; + filt_phase1_p <= filt_phase1 and not filt_phase1_d; + filt_zero_ph_p <= filt_zero_ph and not filt_zero_ph_d; + filt_prod_det_p <= filt_prod_det and not filt_prod_det_d; + enc_out_p <= enc_out and not enc_out_d; + pd_out_p <= pd_out and not pd_out_d; + fire_req_p <= fire_req and not fire_req_d; + + rst_counters <= rst_counters_i or init; + + ----------------------------------------------------------------------------- + -- Speed and acceleration measurements + ----------------------------------------------------------------------------- + + pMeasure : process(clk) + begin + if(clk = '1' and clk'event) then + if(rst_measur = '1' or meas_enc_p = '1') then + meas_pulse_cnt <= (others => '0'); + elsif(enc_out_d = '1') then + meas_pulse_cnt <= std_logic_vector(unsigned(meas_pulse_cnt)+1); + end if; + if(rst_measur = '1') then + meas_enc_pulse <= (others => '0'); + else + meas_enc_pulse <= meas_enc_pulse(meas_enc_pulse'high-1 downto 0) & meas_enc_p; + end if; + if(rst_measur = '1' or meas_enc_pulse(0) = '1') then + enc_delta_time_cnt <= (others => '0'); + else + enc_delta_time_cnt <= std_logic_vector(unsigned(enc_delta_time_cnt)+1); + end if; + if(rst_measur = '1') then + enc_delta_time <= (others => '0'); + enc_delta_time_prev <= (others => '0'); + elsif(meas_enc_pulse(0) = '1') then + enc_delta_time <= enc_delta_time_cnt; + enc_delta_time_prev <= enc_delta_time; + end if; + if(rst_measur = '1' or rst_counters = '1') then + enable_diff_measur_cnt <= (others => '0'); + elsif(meas_enc_p = '1') then + enable_diff_measur_cnt <= std_logic_vector(unsigned(enable_diff_measur_cnt)+1); + end if; + if(rst_measur = '1' or rst_counters = '1') then + enable_diff_measur <= '0'; + elsif(enable_diff_measur_cnt = "11") then + enable_diff_measur <= '1'; + end if; + if(enable_diff_measur = '0') then + enc_delta_time_min <= (others => '1'); + elsif(meas_enc_pulse(2) = '1' and unsigned(enc_delta_time) < unsigned(enc_delta_time_min)) then + enc_delta_time_min <= enc_delta_time; + end if; + if(enable_diff_measur = '0') then + enc_delta_time_max <= (others => '0'); + elsif(meas_enc_pulse(2) = '1' and unsigned(enc_delta_time) > unsigned(enc_delta_time_max)) then + enc_delta_time_max <= enc_delta_time; + end if; + end if; + end process pMeasure; + + meas_enc_p <= '1' when enc_out_p = '1' and unsigned(meas_pulse_cnt) = unsigned(meas_step) else '0'; + + rst_measur <= rst_measur_i or init; + + ----------------------------------------------------------------------------- + -- Direction detection & Position Tracking + ----------------------------------------------------------------------------- + + -- Direction is detected by checking the order of rising and falling edged + -- between phase-0 and phase-1. + -- Forward direction => Phase-0 is anticipated w.r.t. Phase-1 + -- Backward direction => Phase-0 is delayed w.r.t. Phase-1 + + ph0_rising <= filt_phase0_p; + ph0_falling <= not filt_phase0 and filt_phase0_d; + ph1_rising <= filt_phase1_p; + ph1_falling <= not filt_phase1 and filt_phase1_d; + + rst_dir <= rst_dir_i or init; + + -- Use a FSM to detect the sequence of events: + -- FSM Status Register + pFSM_SR : process(clk) + begin + if(clk = '1' and clk'event) then + if(rst_dir = '1') then + fsm_status_curr <= idle; + else + fsm_status_curr <= fsm_status_next; + end if; + end if; + end process pFSM_SR; + + -- FSM Combinational Logic + pFSM_CL : process(fsm_status_curr, ph0_rising, ph0_falling, ph1_rising, ph1_falling) + begin + -- default assignments + set_dir_forward <= '0'; + set_dir_backward <= '0'; + -- + fsm_status_next <= fsm_status_curr; + + case fsm_status_curr is + when idle => + if(ph0_rising = '1') then + fsm_status_next <= wait_ph1_ris; + elsif(ph1_rising = '1') then + fsm_status_next <= wait_ph0_ris; + end if; + + when wait_ph1_ris => + if(ph1_rising = '1') then + set_dir_forward <= '1'; + fsm_status_next <= idle; + elsif(ph0_falling = '1') then + fsm_status_next <= idle; + end if; + + when wait_ph0_ris => + if(ph0_rising = '1') then + set_dir_backward <= '1'; + fsm_status_next <= idle; + elsif(ph1_falling = '1') then + fsm_status_next <= idle; + end if; + + when others => null; + end case; + end process pFSM_CL; + + pDirRegs : process(clk) + begin + if(clk = '1' and clk'event) then + if(rst_dir = '1') then + dir_cnt <= (others => '0'); + elsif(set_dir_forward = '1' and dir_pos_sat = '0') then + dir_cnt <= std_logic_vector(signed(dir_cnt)+1); + elsif(set_dir_backward = '1' and dir_neg_sat = '0') then + dir_cnt <= std_logic_vector(signed(dir_cnt)-1); + end if; + direction_d <= direction; + if(rst_dir = '1') then + dir_change_cnt <= (others => '0'); + elsif(direction_change = '1') then + dir_change_cnt <= std_logic_vector(unsigned(dir_change_cnt)+1); + end if; + end if; + end process pDirRegs; + + direction <= dir_cnt(dir_cnt'high); + direction_change <= direction xor direction_d; + + -- Positive/Negative saturation for the direction counter + dir_pos_sat <= '1' when signed(dir_cnt) > signed(pos_dir_thres) else '0'; + dir_neg_sat <= '1' when signed(dir_cnt) < signed(neg_dir_thres) else '0'; + + -- Position Tracking + pPOS_TRACK : process(clk) + begin + if(clk = '1' and clk'event) then + if(rst_pos = '1') then + pos_cnt <= (others => '0'); + elsif(pos_step = '1') then + pos_cnt <= std_logic_vector(signed(pos_cnt)+1); + elsif(neg_step = '1') then + pos_cnt <= std_logic_vector(signed(pos_cnt)-1); + end if; + abs_position <= pos_cnt; + end if; + end process pPOS_TRACK; + + rst_pos <= init or rst_pos_i; + + ----------------------------------------------------------------------------- + -- PD logging + ----------------------------------------------------------------------------- + + pPD_log : process(clk) + begin + if(clk = '1' and clk'event) then + if(init = '1') then + pd_fifo_error <= '0'; + elsif(pd_fifo_wr_en = '1' and pd_fifo_full = '1') then + pd_fifo_error <= '1'; + end if; + if(init = '0' and pd_p = '1') then + pd_data_sel <= "001"; + else + pd_data_sel <= pd_data_sel(1 downto 0) & '0'; + end if; + if(init = '1') then + fine_time_l <= (others => '0'); + coarse_time_l <= (others => '0'); + pd_pos <= (others => '0'); + elsif(pd_p = '1') then + fine_time_l <= fine_time; + coarse_time_l <= coarse_time; + pd_pos <= pos_cnt; + end if; + end if; + end process pPD_log; + + pd_p <= pd_out_p when pd_log_src = '1' else filt_prod_det_p; + + iPD_log_fifo : entity work.sync_fifo + generic map( + FIFO_WIDTH => 32, + FIFO_DEPTH => 256) + port map ( + clock => clk, + data => pd_fifo_d, + rdreq => pd_fifo_rd_en, + sclr => rst_pd_fifo, + wrreq => pd_fifo_wr_en, + empty => open, + full => pd_fifo_full, + q => pd_fifo_q, + usedw => pd_fifo_usedw); + + pd_fifo_rd_en <= '1' when avs_read = '1' and avs_address = PD_FIFO_OUT_REG else '0'; + + pd_fifo_alarm <= '1' when unsigned(pd_fifo_usedw) >= unsigned(pd_fifo_thres) else '0'; + + -- FIFO write logic + pd_fifo_wr_en <= pd_data_sel(2) or pd_data_sel(1) or pd_data_sel(0); + + -- select the input for the pd fifo + with pd_data_sel select + pd_fifo_d <= + X"0" & fine_time_l when "001", + coarse_time_l when "010", + pd_pos when others; + + rst_pd_fifo <= rst_pd_fifo_i or init; + + -- PD Positional Watch-Dog + pPD_WatchDog : process(clk) + begin + if(clk = '1') then + if(init = '1' or clr_pd_pos = '1' or filt_prod_det_p = '1') then + pd_delta_pos <= (others => '0'); + elsif(pos_step = '1') then + pd_delta_pos <= std_logic_vector(signed(pd_delta_pos)+1); + elsif(neg_step = '1') then + pd_delta_pos <= std_logic_vector(signed(pd_delta_pos)-1); + end if; + -- compare the absolute value of the delta position against the + -- threshold. Use the 1's complement to save some logic. + if(pd_wd_en = '1' and unsigned(pd_delta_pos_abs) > unsigned(pd_wd_thres)) then + pd_wd_alarm <= '1'; + else + pd_wd_alarm <= '0'; + end if; + end if; + end process pPD_WatchDog; + + pd_delta_pos_abs <= '0' & pd_delta_pos(30 downto 0) when pd_delta_pos(31) = '0' else '0' & not pd_delta_pos(30 downto 0); + + ----------------------------------------------------------------------------- + -- Encoder pulse count buffering (ACTUALLY NOW IS POSITION COUNT SAMPLING!!!) + ----------------------------------------------------------------------------- + + -- The encoder pulse count is periodically sampled. The samples are stored in + -- a dedicated FIFO and they can be used to generate a speed/acceleration + -- profile. => CHANGED: JUST using the position count, because it is more + -- it is independent of the encoder directionality settings + + pEncPulseSample : process(clk) + begin + if(clk = '1' and clk'event) then + if(rst_fifo = '1' or sampling_time = '1') then + sampling_time_cnt <= (others => '0'); + else + sampling_time_cnt <= std_logic_vector(unsigned(sampling_time_cnt)+1); + end if; + if(rst_fifo = '1') then + fifo_error <= '0'; + elsif(fifo_wr_en = '1' and fifo_full = '1') then + fifo_error <= '1'; + end if; + fifo_wr_en <= sampling_time; + --fifo_d <= enc_out_cnt; + fifo_d <= pos_cnt; + end if; + end process pEncPulseSample; + + sampling_time <= '1' when unsigned(sampling_time_cnt) = unsigned(sampling_period) else '0'; + + iEncPulseFifo : entity work.sync_fifo + generic map( + FIFO_WIDTH => 32, + FIFO_DEPTH => 1024) + port map ( + clock => clk, + data => fifo_d, + rdreq => fifo_rd_en, + sclr => rst_fifo, + wrreq => fifo_wr_en, + empty => open, + full => fifo_full, + q => fifo_q, + usedw => fifo_usedw); + + fifo_rd_en <= '1' when avs_read = '1' and avs_address = ENC_FIFO_OUT_REG else '0'; + + enc_fifo_alarm <= '1' when unsigned(fifo_usedw) >= unsigned(fifo_thres) else '0'; + + rst_fifo <= init or rst_fifo_i or rst_counters_i; + + ----------------------------------------------------------------------------- + -- IRQ generation and management + ----------------------------------------------------------------------------- + + pIRQ : process(reset_n, clk) + begin + if(reset_n = '0') then + ins_diag_irq_0 <= '0'; + ins_diag_irq_1 <= '0'; + ins_diag_irq_2 <= '0'; + irq <= "000"; + irq_src_d <= "000"; + elsif(clk = '1' and clk'event) then + irq_src_d <= irq_src; + for n in 0 to 2 loop + if(irq_clr(n) = '1') then + irq(n) <= '0'; + elsif(irq_en(n) = '1' and irq_src(n) = '1' and irq_src_d(n) = '0') then + irq(n) <= '1'; + end if; + end loop; -- n + ins_diag_irq_0 <= irq_val(0); + ins_diag_irq_1 <= irq_val(1); + ins_diag_irq_2 <= irq_val(2); + end if; + end process pIRQ; + + irq_val <= irq and not irq_mask; + irq_src <= pd_wd_alarm & pd_fifo_alarm & enc_fifo_alarm; + + ----------------------------------------------------------------------------- + -- C&S registers (Avalon-MM I/F) + ----------------------------------------------------------------------------- + + pCTRL_STATUS : process(reset_n, clk) + begin + if(reset_n = '0') then + avs_read_i <= '0'; + avs_readdatavalid <= '0'; + avs_readdata <= (others => '0'); + -- + init_i <= '0'; + rst_counters_i <= '0'; + rst_measur_i <= '0'; + rst_dir_i <= '0'; + rst_fifo_i <= '0'; + rst_pos_i <= '0'; + rst_pd_fifo_i <= '0'; + pd_log_src <= '0'; + pd_wd_en <= '0'; + clr_pd_pos <= '0'; + irq_en <= "000"; + irq_clr <= "000"; + irq_mask <= "000"; + meas_step <= (0 => '1', others => '0'); + sampling_period <= (others => '0'); + pos_dir_thres <= X"007F"; -- +127 + neg_dir_thres <= X"FF81"; -- -127 + elsif(clk = '1' and clk'event) then + -- CTRL registers + if(avs_write = '1') then + case avs_address is + when DIAG_INIT_REG => + init_i <= avs_writedata( 0); + rst_counters_i <= avs_writedata( 1); + rst_measur_i <= avs_writedata( 2); + rst_dir_i <= avs_writedata( 3); + rst_fifo_i <= avs_writedata( 4); + rst_pos_i <= avs_writedata( 5); + rst_pd_fifo_i <= avs_writedata( 6); + when ENC_D_TIME_MEAS_STEP => + meas_step <= avs_writedata(meas_step'range); + when DIR_COUNT_THRES_REG => + pos_dir_thres <= avs_writedata(15 downto 0); + neg_dir_thres <= avs_writedata(31 downto 16); + when ENC_SAMPL_PER_REG => + sampling_period <= avs_writedata(sampling_period'range); + when ENC_FIFO_CS_REG => + fifo_thres <= avs_writedata(fifo_thres'range); + when PD_FIFO_CS_REG => + pd_fifo_thres <= avs_writedata(pd_fifo_thres'range); + pd_log_src <= avs_writedata(15); + when PD_WATCH_DOG_CTRL => + pd_wd_en <= avs_writedata( 0); + clr_pd_pos <= avs_writedata( 1); + when PD_WATCH_DOG_THRES => + pd_wd_thres <= avs_writedata; + when IRQ_MNG_REG => + irq_en <= avs_writedata( 2 downto 0); + irq_clr <= avs_writedata( 6 downto 4); + irq_mask <= avs_writedata(10 downto 8); + when others => null; + end case; + end if; + + -- Read Ctrl & Status registers + avs_read_i <= avs_read; + -- Read valid is delayed of an additional clock cycle to take into + -- account for the FIFO latency + avs_readdatavalid <= avs_read_i; + if(avs_read_i = '1') then + case avs_address is + when DIAG_INIT_REG => + avs_readdata <= X"000000" & b"0" & rst_pd_fifo_i & rst_pos_i & rst_fifo_i & rst_dir_i & rst_measur_i & rst_counters_i & init_i; + when DIAG_IN_STATUS_REG => + avs_readdata(input_status'range) <= input_status; + avs_readdata(31 downto input_status'length) <= (others => '0'); + when PHASE0_CNT_REG => + avs_readdata <= filt_phase0_cnt; + when PHASE1_CNT_REG => + avs_readdata <= filt_phase1_cnt; + when ZERO_PH_CNT_REG => + avs_readdata <= filt_zero_ph_cnt; + when PD_CNT_REG => + avs_readdata <= filt_prod_det_cnt; + when ENC_OUT_CNT_REG => + avs_readdata <= enc_out_cnt; + when PD_OUT_CNT_REG => + avs_readdata <= pd_out_cnt; + when FIRE_REQ_CNT_REG => + avs_readdata <= fire_req_cnt; + when ENC_D_TIME_REG => + avs_readdata <= enc_delta_time; + when ENC_DMIN_TIME_REG => + avs_readdata <= enc_delta_time_min; + when ENC_DMAX_TIME_REG => + avs_readdata <= enc_delta_time_max; + when ENC_D_TIME_PREV_REG => + avs_readdata <= enc_delta_time_prev; + when ENC_D_TIME_MEAS_STEP => + avs_readdata <= X"0000" & meas_step; + when POSITION_CNT_REG => + avs_readdata <= pos_cnt; + when DIR_COUNT_THRES_REG => + avs_readdata <= neg_dir_thres & pos_dir_thres; + when DIR_COUNT_REG => + avs_readdata <= dir_change_cnt & dir_cnt; + when ENC_SAMPL_PER_REG => + avs_readdata <= X"0" & sampling_period; + when ENC_FIFO_CS_REG => + avs_readdata <= fifo_error & b"00000" & fifo_usedw & b"000000" & fifo_thres; + when ENC_FIFO_OUT_REG => + avs_readdata <= fifo_q; + when PD_FIFO_CS_REG => + avs_readdata <= pd_fifo_error & b"0000000" & pd_fifo_usedw & pd_log_src & b"0000000" & pd_fifo_thres; + when PD_FIFO_OUT_REG => + avs_readdata <= pd_fifo_q; + when PD_WATCH_DOG_CTRL => + avs_readdata <= (0 => pd_wd_en, 1 => clr_pd_pos, 4 => pd_wd_alarm, others => '0'); + when PD_WATCH_DOG_THRES => + avs_readdata <= pd_wd_thres; + when IRQ_MNG_REG => + avs_readdata <= X"0000" & '0' & irq_val & '0' & irq_mask & '0' & irq_clr & '0' & irq_en; + when others => + avs_readdata <= X"BAD1BAD0"; + end case; + end if; + end if; + end process pCTRL_STATUS; + +end architecture rtl; diff --git a/generic_ip/fire_pulse_manager/5/src/test/fire_pulse_manager_5_tb.vhd b/generic_ip/fire_pulse_manager/5/src/test/fire_pulse_manager_5_tb.vhd new file mode 100644 index 0000000..1d1226f --- /dev/null +++ b/generic_ip/fire_pulse_manager/5/src/test/fire_pulse_manager_5_tb.vhd @@ -0,0 +1,719 @@ +------------------------------------------------------------------------------- +-- Title : fire_pulse_manager_tb +-- Project : fire_pulse_manager +------------------------------------------------------------------------------- +-- File : fire_pulse_manager_tb.vhd +-- Author : Christos Spirotis +-- Company : Global Inkjet Systems +-- Created : 2018-08-10 +-- Last update: 2019-12-16 +-- SVN ID : Git +-- Standard : VHDL'08 +------------------------------------------------------------------------------- +-- Description: +-- Testbench for fire pulse manager block +------------------------------------------------------------------------------- + +library modelsim_lib; +use modelsim_lib.util.all; +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; +use ieee.math_real.all; +use std.textio.all; +library work; +use work.fire_pulse_5_pkg.all; +use work.log_pkg.all; +use work.avalon_verify_pkg.all; +use work.pulse_generator_2_pkg.all; +use work.enc_pd_emul_1_pkg.CSR_ENC_NCO_INC_ADDR; +use work.enc_pd_emul_1_pkg.CSR_ENC_CTRL_ADDR; +use work.enc_pd_emul_1_pkg.CSR_PD_CTRL_ADDR; +use work.enc_pd_emul_1_pkg.CSR_OUT_ENABLE_ADDR; +use work.enc_pd_emul_1_pkg.CSR_PULSE_NUM_ADDR; + +library osvvm; +use osvvm.RandomPkg.all; + +entity fire_pulse_manager_5_tb is +end fire_pulse_manager_5_tb; + +architecture behav of fire_pulse_manager_5_tb is + + constant CH_NUM : integer := 4; + constant DEV_NUM : integer := 2; + + + constant CLK_PERIOD : time := 10.0 ns; + constant CLK_FREQ : real := 100.0e6; + + -- TODO Try different receive oversampling ratios - 300MHz is in the real system + constant RX_CLK_PERIOD : time := CLK_PERIOD / 3; -- clock period for used by the + -- UART-Rx on the POF + + constant POF_DELAY : time := 30 ns; -- Total delay from POF-Tx input to POF-Rx output + + constant NUM_ITERATIONS : natural := 5; + constant SWATHE_LEN : integer := 600; + constant START_DIR : std_logic := '0'; + constant TIME_INT : time := 5000 ns; + constant VERBOSITY_LEVEL : verb_level_t := VMEDIUM; + + type ch_offset_t is array (0 to CH_NUM - 1) of integer; + signal ch_offset : ch_offset_t := (100, 308, 316, 324); + + type avs_read_bus_t is array (0 to DEV_NUM - 1) of std_logic_vector(31 downto 0); + + signal reset_n : std_logic := '0'; + signal clk : std_logic := '0'; + signal rx_clk : std_logic := '0'; + signal pof_tx, pof_rx : std_logic; + signal ch_pulse_out : std_logic_vector(3 downto 0); + signal avs_address : std_logic_vector(14 downto 0); + signal avs_write : std_logic_vector(DEV_NUM - 1 downto 0); + signal avs_writedata : std_logic_vector(31 downto 0); + signal avs_read : std_logic_vector(DEV_NUM - 1 downto 0); + signal avs_waitrequest : std_logic_vector(DEV_NUM - 1 downto 0); + signal avs_readdata : avs_read_bus_t; + -- + signal init_tx : std_logic; + signal pd_in : std_logic; + signal pd_spy : std_logic; + signal inc_pos : std_logic; + signal dec_pos : std_logic; + signal abs_position : std_logic_vector(31 downto 0); + signal abs_spy : std_logic_vector(31 downto 0); + signal tx_data : std_logic; + signal pof_tx_avs_rv : std_logic; + signal pof_tx_avs_we_d : std_logic; + -- + signal abs_position_d : std_logic_vector(31 downto 0); + signal dir_in : std_logic; + signal swathe_cnt : integer; + signal swathe_pos : integer; + signal end_of_swathe : std_logic; + signal test_completed : boolean; + signal running : boolean; + signal configuring : boolean; + signal passed : boolean; + signal failed : boolean; + signal stimuli_completed : boolean; + signal detected_error : boolean := false; + signal registers_read : boolean := false; + signal reprogram_offset : boolean := false; + + -- + signal avs_m : mm_m_rec_t; + signal avs_s : mm_s_rec_t; + signal sel_slave_0 : std_logic; + signal sel_slave_1 : std_logic; + -- + type pd_cnt_t is array (0 to CH_NUM - 1) of integer; + signal pd_cnt : pd_cnt_t; + type fp_cnt_t is array (0 to CH_NUM - 1) of integer; + signal fp_cnt : fp_cnt_t; + + -- generate the NCO increment corresponding to a given output frequency + function freq2NCO_inc( + f_out : real; f_clk : real) return std_logic_vector is + variable nco_inc : std_logic_vector(31 downto 0); + + begin + nco_inc := std_logic_vector(to_unsigned(integer((f_out / f_clk) * (2.0**32)), 32)); + return nco_inc; + + end function freq2NCO_inc; + +begin -- behav + + clk_pr : process + begin + clk <= '0'; + wait for 0.5 * CLK_PERIOD; + clk <= '1'; + wait for 0.5 * CLK_PERIOD; + end process clk_pr; + + rx_clk_pr : process + begin + rx_clk <= '0'; + wait for 0.5 * RX_CLK_PERIOD; + rx_clk <= '1'; + wait for 0.5 * RX_CLK_PERIOD; + end process rx_clk_pr; + + ----------------------------------------------------------------------------- + -- DUTs : Fire Pulse Manager + ----------------------------------------------------------------------------- + + iDUT : entity work.fire_pulse_manager_5 + generic map( + CH_NUM => CH_NUM) + port map( + reset_n => reset_n, + clk => clk, + rx_clk => rx_clk, + pof_rx => pof_rx, + pof_tx => pof_tx, + fire_pulse => ch_pulse_out, + mon_pt => open, + ins_fpm_irq_0 => open, + ins_fpm_irq_1 => open, + ins_fpm_irq_2 => open, + ins_fpm_irq_3 => open, + avs_address => avs_address, + avs_write => avs_write(0), + avs_writedata => avs_writedata, + avs_read => avs_read(0), + avs_waitrequest => avs_waitrequest(0), + avs_readdata => avs_readdata(0) + ); + + pof_rx <= transport tx_data after POF_DELAY; + + ----------------------------------------------------------------------------- + -- POF Tx + ----------------------------------------------------------------------------- + + iPOF_TX : entity work.pof_tx_0 + port map( + reset_n => reset_n, + clk => clk, + init => init_tx, + pd_in => pd_in, + inc_pos => inc_pos, + dec_pos => dec_pos, + abs_position => abs_position, + tx_data => tx_data, + avs_address => avs_address(2 downto 0), + avs_write => avs_write(1), + avs_writedata => avs_writedata, + avs_read => avs_read(1), + avs_readdatavalid => pof_tx_avs_rv, + avs_readdata => avs_readdata(1)); + + -- Generate a dummy waitrequest for the POF-tx + pPOF_TX_DUMMY_WR : process(clk) + begin + if(clk = '1' and clk'event) then + pof_tx_avs_we_d <= avs_write(1); + end if; + end process pPOF_TX_DUMMY_WR; + + avs_waitrequest(1) <= '0' when pof_tx_avs_we_d = '1' or pof_tx_avs_rv = '1' else '0'; + + ----------------------------------------------------------------------------- + -- Stimuli Generation + ----------------------------------------------------------------------------- + + pSTIMULI_REGs : process(clk) + begin + if (clk = '1' and clk'event) then + abs_position_d <= abs_position; + end if; + end process pSTIMULI_REGs; + + inc_pos <= '1' when signed(abs_position) = signed(abs_position_d) + 1 else '0'; + dec_pos <= '1' when signed(abs_position) = signed(abs_position_d) - 1 else '0'; + + pSTIMULI : process + variable end_of_stimuli : boolean; + variable rv : RandomPType; + + begin + + -- initialization + init_tx <= '0'; + dir_in <= START_DIR; + pd_in <= '0'; + abs_position <= (others => '0'); + swathe_pos <= 0; + -- + swathe_cnt <= 0; + stimuli_completed <= false; + end_of_swathe <= '0'; + + -- generating the stimulus + wait until running = true; + wait for 200 ns; + -- Send a Init/Sync pulse + wait until clk = '1' and clk'event; + init_tx <= '1'; + wait until clk = '1' and clk'event; + init_tx <= '0'; + wait for 500 ns; + -- + -- generate the forward swathe + end_of_stimuli := false; + while end_of_stimuli = false loop + swathe_pos <= 0; + + for i in 0 to CH_NUM - 1 loop + ch_offset(i) <= rv.RandInt(0, 379); + end loop; + reprogram_offset <= true; + wait until configuring = true; + reprogram_offset <= false; + wait until configuring = false; + + wait until clk = '1' and clk'event; + + while swathe_pos /= SWATHE_LEN loop + wait until clk = '1' and clk'event; + --generate a position increment + swathe_pos <= swathe_pos + 1; + if (dir_in = '0') then + abs_position <= std_logic_vector(signed(abs_position) + 1); + else + abs_position <= std_logic_vector(signed(abs_position) - 1); + end if; + -- + if (swathe_pos = 16) then + -- generate a PD increment: the PD might be either concurren or not + -- to the position increment + wait for 0.5 * CLK_PERIOD; + pd_in <= '1'; + wait for 100 ns; + wait until clk = '1' and clk'event; + pd_in <= '0'; + end if; + wait for TIME_INT; + end loop; -- swathe_pos /= SWATHE_LEN + + wait for 25 us; + end_of_swathe <= '1'; + wait until clk = '1' and clk'event; + end_of_swathe <= '0'; + -- reverse direction + if (dir_in /= START_DIR) then + if (swathe_cnt = NUM_ITERATIONS - 1) then + end_of_stimuli := true; + else + swathe_cnt <= swathe_cnt + 1; + end if; + end if; + if (end_of_stimuli = false) then + wait until clk = '1' and clk'event; + dir_in <= not dir_in; + -- Wait some time to make sure the change of direction is transmitted. + -- Note: if the position starts changing before the receiver was able to + -- confirm the change of direction, then some encoder pulses may not be + -- generated + wait for 1 us; + wait until clk = '1' and clk'event; + end if; + end loop; -- end_of_stimuli = false + + stimuli_completed <= true; + wait; + + end process pSTIMULI; + + ----------------------------------------------------------------------------- + -- Testbench Control + ----------------------------------------------------------------------------- + + pTB_CTRL : process + type fp_arrived_t is array (0 to CH_NUM - 1) of boolean; + variable fp_arrived : fp_arrived_t; + type fp_arrived_time_t is array (0 to CH_NUM - 1) of integer; + variable fp_arrived_time : fp_arrived_time_t; + variable fp_arrived_agg : integer; + variable pd_arrived_time : integer; + + begin + -- init_signal_spy("/iDUT/abs_pos","abs_spy",0); + -- init_signal_spy("/iDUT/pd_pulse","pd_spy",0); + init_signal_spy("abs_position", "abs_spy", 0); + init_signal_spy("pd_in", "pd_spy", 0); + + -- Set the verbosity level for logging + set_log_verbosity(VERBOSITY_LEVEL); + set_log_verbosity(VHIGH); + + log_header("Multi-channel FPM verification:", VLOW); + + test_completed <= false; + running <= false; + passed <= false; + failed <= false; + + -- Reset + reset_n <= '0'; + wait for 100 ns; + wait until clk = '1' and clk'event; + reset_n <= '1'; + + if (configuring /= true) then + wait until configuring = true; + end if; + wait until configuring = false; + running <= true; + log("Running test ... ", VLOW, true); + + while stimuli_completed = false loop + wait until ((pd_spy = '1' and pd_spy'event) or stimuli_completed); + + if (stimuli_completed) then + exit; + end if; + + pd_arrived_time := to_integer(signed(abs_spy)); + for i in 0 to CH_NUM - 1 loop + fp_arrived(i) := false; + fp_arrived_time(i) := 0; + end loop; + log("Product detect fired @ " & integer'image(pd_arrived_time) & " ... ", VLOW, true); + fp_arrived_agg := 0; + while fp_arrived_agg < CH_NUM loop + fp_arrived_agg := 0; + for i in 0 to CH_NUM - 1 loop + if fp_arrived(i) = true then + fp_arrived_agg := fp_arrived_agg + 1; + end if; + end loop; + + wait until (unsigned(ch_pulse_out) /= 0 or stimuli_completed); + if (stimuli_completed) then + exit; + end if; + + for i in 0 to CH_NUM - 1 loop + if ch_pulse_out(i) = '1' and fp_arrived(i) = false then + fp_arrived(i) := true; + fp_arrived_time(i) := to_integer(signed(abs_spy)); + log("Channel CH" & integer'image(i) & " Fire pulse logged @ " & integer'image(fp_arrived_time(i)) & " ... ", VLOW, true); + if (abs (pd_arrived_time - fp_arrived_time(i)) /= ch_offset(i)) then + log("Channel CH" & integer'image(i) & " OFFSET INCORRECT !!! ", VLOW, true); + detected_error <= true; + end if; + end if; + end loop; + end loop; + end loop; + + if (stimuli_completed = true) then + -- wait enough time to make sure that a max length package can be propagated + wait for 20 us; + end if; + + if (registers_read = false) then + wait until registers_read = true; + end if; + + -- Report PD and FP counter from pulse generator + for i in 0 to CH_NUM - 1 loop + log("Channel CH" & integer'image(i) & " PDin counter value : " & integer'image(pd_cnt(i)) & " ... ", VLOW, true); + log("Channel CH" & integer'image(i) & " FPout counter value : " & integer'image(fp_cnt(i)) & " ... ", VLOW, true); + if (i = 0 and (pd_cnt(i) /= (NUM_ITERATIONS) * 2)) or + (i /= 0 and pd_cnt(i) /= 0) then -- fire_pulse_manager now has no registers beyond channel 0 + log("Channel CH" & integer'image(i) & " PD_cnt counter value Incorrect: ", VLOW, true); + detected_error <= true; + end if; + if (i = 0 and (fp_cnt(i) /= (NUM_ITERATIONS) * 2 * 100)) or + (i /= 0 and fp_cnt(i) /= 0) then + log("Channel CH" & integer'image(i) & " FP_cnt counter value Incorrect: ", VLOW, true); + detected_error <= true; + end if; + end loop; + + wait until clk = '1' and clk'event; + + if (detected_error = true) then + failed <= true; + log("FAILURE: test completed with errors.", VLOW); + else + passed <= true; + log("SUCCESS: test successfully completed.", VLOW); + end if; + log_separator_line(VLOW); + test_completed <= true; + running <= false; + wait; + + end process pTB_CTRL; + + pUUT_CTRL : process + variable addr : std_logic_vector(31 downto 0) := (others => '0'); + variable data : std_logic_vector(31 downto 0) := (others => '0'); + variable ratio_int : integer; + variable ratio_slv : std_logic_vector(33 downto 0); + + begin + sel_slave_0 <= '0'; + sel_slave_1 <= '0'; + configuring <= true; + + -- initilialize the Avalon master-bus + mm_m_init(avs_m, use_waitrequest => true); + + if (reset_n = '0') then + wait until reset_n = '1'; + wait for 100 ns; + wait until clk = '1' and clk'event; + end if; + + log("Configuring POFTX ... ", VLOW, true); + sel_slave_1 <= '1'; + -- Config netfork_tx control registers: + -- enable the block + addr := std_logic_vector(to_unsigned(0, 32)); + data := X"0000_0021"; + mm_32b_write(addr, data, avs_s, avs_m); + + sel_slave_1 <= '0'; + sel_slave_0 <= '1'; + wait until clk = '1' and clk'event; + + log("Configuring EMUL ... ", VLOW, true); + -- Configure Encoder NCO freq + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_ENC_NCO_INC_ADDR)), 32)); + data := freq2NCO_inc(200.0e3, CLK_FREQ); + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + -- Enable outputs + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_OUT_ENABLE_ADDR)), 32)); + data := X"000000FF"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + + log("Configuring FPM ... ", VLOW, true); + -- Config fire_pulse_manager control registers: + -- Enable the POF-Rx + addr := std_logic_vector(to_unsigned(3, 32)); + data := X"0000_8061"; -- set bit_div to 6 to match the 50MBd TX signal to the 300MHz RX_CLK + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + -- Select pulse generator + addr := std_logic_vector(to_unsigned(2, 32)); + data := X"0000_0001"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + -- Config external fire pulses + addr := std_logic_vector(to_unsigned(12, 32)); + data := X"0008_0004"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + + config_pg_l : for i in 0 to CH_NUM - 1 loop + -- Disable/Re-enable first the whole pulse_generator + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(PULSE_GEN_CTRL_REG)), 32)); + data := (others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + data := (0 => '1', 16 => '1', others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + -- Disable/Re-enable the Channel Controller sequencer + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_CTRL_CTRL_REG)), 32)); + data := (others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_CTRL_CTRL_REG)), 32)); + data := (0 => '1', others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + -- set the sub-pixel offset + data := std_logic_vector(to_unsigned(0, 32)); + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SP_OFFSET_INT)), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + data := std_logic_vector(to_unsigned(0, 32)); + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SP_OFFSET_FRAC)), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + -- set the division ratio + ratio_int := integer(2.0 * real(2**24)); + ratio_slv := std_logic_vector(to_unsigned(ratio_int, 34)); + -- Set the integer part of the div-ratio + data(31 downto 10) := (others => '0'); + data(9 downto 0) := ratio_slv(33 downto 24); + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(DIV_RATIO_INT)), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + -- Set the fractional part of the div-ratio + data(31 downto 24) := (others => '0'); + data(23 downto 0) := ratio_slv(23 downto 0); + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(DIV_RATIO_FRAC)), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + -- Disable/Enable the fractional divider + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(FRAC_DIV_CTRL_REG)), 32)); + data := (others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + data := (0 => '1', others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + -- Configure the Channel Offset (Both DIR_0 and DIR_1): + -- DIR_0 + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_OFFSET_D0_REG)), 32)); + data := std_logic_vector(to_unsigned(ch_offset(i), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + -- DIR_1 + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_OFFSET_D1_REG)), 32)); + data := std_logic_vector(to_unsigned(ch_offset(i), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + -- Configure the Channel Delay + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_DELAY_REG)), 32)); + data := std_logic_vector(to_unsigned(0, 32)); + mm_32b_write(addr, data, avs_s, avs_m); + + -- Fill Sequencer RAM with simple swathe DIR-0 + -- 0x00, 0x30000000 – Reset the vector output value + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET)), 32)); + data := X"30000000"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x01, 0x10000001 – Trigger Mask (PD trigger enabled) + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 1), 32)); + data := X"10000001"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x02, 0x20000001 – Wait for a single PD event + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 2), 32)); + data := X"20000001"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x03, 0x30006404 – Issue a request for starting the generation of 100 fire pulses (DIR-0) + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 3), 32)); + data := X"30006404"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x04, 0x30006400 – De-assert the request bit (start_image_req) + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 4), 32)); + data := X"30006400"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x05, 0x80000258 – Wait till POS END + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 5), 32)); + data := X"80000258"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x06, 0xC0000000 – Jump to DIR-1 + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 6), 32)); + data := X"C0000010"; + mm_32b_write(addr, data, avs_s, avs_m); + + -- Fill Sequencer RAM with simple swathe DIR-1 + -- 0x10, 0x30000000 – Reset the vector output value + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 16), 32)); + data := X"30000001"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x11, 0x10000001 – Trigger Mask (PD trigger enabled) + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 17), 32)); + data := X"10000001"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x12, 0x20000001 – Wait for a single PD event + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 18), 32)); + data := X"20000001"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x13, 0x30006405 – Issue a request for starting the generation of 100 fire pulses (DIR-1) + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 19), 32)); + data := X"30006405"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x14, 0x30006401 – De-assert the request bit (start_image_req) + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 20), 32)); + data := X"30006401"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x15, 0x80000000 – Wait till POS START + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 21), 32)); + data := X"80000000"; + mm_32b_write(addr, data, avs_s, avs_m); + -- 0x16, 0xC0000000 – Jump to DIR-0 + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_RAM_OFFSET) + 22), 32)); + data := X"C0000000"; + mm_32b_write(addr, data, avs_s, avs_m); + + -- Start Sequencer + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(SEQ_CSR_OFFSET) + 3), 32)); + data := (0 => '1', others => '0'); + mm_32b_write(addr, data, avs_s, avs_m); + end loop config_pg_l; + + -- Init the encoder NCO - Preset Abs-Pos + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_ENC_CTRL_ADDR)), 32)); + data := 32X"B"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + + log("Configuration completed.", VLOW, true); + configuring <= false; + + while stimuli_completed = false loop + wait until reprogram_offset = true or stimuli_completed = true; + if (stimuli_completed) then + exit; + end if; + + configuring <= true; + log("Reprogramming offset ... ", VLOW, true); + config_of_l : for i in 0 to CH_NUM - 1 loop + -- Configure the Channel Offset (Both DIR_0 and DIR_1): + -- DIR_0 + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_OFFSET_D0_REG)), 32)); + data := std_logic_vector(to_unsigned(ch_offset(i), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + -- DIR_1 + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(CH_OFFSET_D1_REG)), 32)); + data := std_logic_vector(to_unsigned(ch_offset(i), 32)); + mm_32b_write(addr, data, avs_s, avs_m); + end loop; + configuring <= false; + -- issue PD + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_PD_CTRL_ADDR)), 32)); + data := 32X"3"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + if dir_in = '0' then + log("Running 600 steps in DIR-0 ...", VLOW); + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_PULSE_NUM_ADDR)), 32)); + data := 32X"258"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_ENC_CTRL_ADDR)), 32)); + data := 32X"11"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_ENC_CTRL_ADDR)), 32)); + data := 32X"31"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + else + log("Running 600 steps in DIR-1 ...", VLOW); + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_PULSE_NUM_ADDR)), 32)); + data := 32X"258"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_ENC_CTRL_ADDR)), 32)); + data := 32X"15"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + addr := std_logic_vector(to_unsigned(6144 + to_integer(unsigned(CSR_ENC_CTRL_ADDR)), 32)); + data := 32X"35"; + -- Write the data to the register + mm_32b_write(addr, data, avs_s, avs_m); + end if; + end loop; + + -- Read PD and FP counter from pulse generator + for i in 0 to CH_NUM - 1 loop + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(PD_IN_CNT_REG)), 32)); + mm_32b_read(addr, data, avs_s, avs_m); + pd_cnt(i) <= to_integer(unsigned(data)); + addr := std_logic_vector(to_unsigned(8192 + (2048 * i) + to_integer(unsigned(FIRE_REQ_CNT_REG)), 32)); + mm_32b_read(addr, data, avs_s, avs_m); + fp_cnt(i) <= to_integer(unsigned(data)); + end loop; + + registers_read <= true; + + wait; + end process pUUT_CTRL; + + clk_clk <= clk; + reset_reset_n <= reset_n; + + avs_s.mm_readdata <= avs_readdata(0) when sel_slave_0 = '1' else + avs_readdata(1) when sel_slave_1 = '1' else (others => '0'); + + avs_s.mm_readdatavalid <= '0'; + + avs_s.mm_waitrequest <= avs_waitrequest(0) when sel_slave_0 = '1' else + avs_waitrequest(1) when sel_slave_1 = '1' else '0'; + + avs_s.use_readvalid <= false; + + avs_address <= avs_m.mm_address(avs_address'range); + avs_write(0) <= avs_m.mm_write and sel_slave_0; + avs_write(1) <= avs_m.mm_write and sel_slave_1; + avs_writedata <= avs_m.mm_writedata; + avs_read(0) <= avs_m.mm_read and sel_slave_0; + avs_read(1) <= avs_m.mm_read and sel_slave_1; + +end behav; + diff --git a/generic_ip/fire_pulse_manager/Readme.txt b/generic_ip/fire_pulse_manager/Readme.txt index 7f64a4c..a65bf78 100644 --- a/generic_ip/fire_pulse_manager/Readme.txt +++ b/generic_ip/fire_pulse_manager/Readme.txt @@ -10,4 +10,6 @@ Fire-Pulse-Manager major versions: - 4: Programmable Channel: different features can be programmed through VHDL generic: Number of channels, instantion of Diagnostic block, event logger, POF Protocol type, - additional logic for usage TOF Compensation, Pixel-Pitch correction \ No newline at end of file + additional logic for usage TOF Compensation, Pixel-Pitch correction + +- 5 FPM-5 fully replaces FPM-4. It Includes support for SEB-EPD => EMS block instantiated at place of POF-Rx block, based on the value of a VHDL generic. \ No newline at end of file