├── .gitignore ├── .gitmodules ├── .travis.yml ├── ActionTypes.md ├── BugReporting.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── actions ├── .gitignore ├── Makefile ├── README.md ├── hdl_example │ ├── Makefile │ ├── README.md │ ├── doc │ │ ├── README.md │ │ ├── main_blocks.png │ │ └── top_blocks.png │ ├── hw │ │ ├── Makefile │ │ ├── action_axi_master.vhd │ │ ├── action_axi_nvme.vhd │ │ ├── action_axi_slave.vhd │ │ ├── action_config.sh │ │ ├── action_example.vhd_source │ │ ├── action_types.vhd │ │ └── action_wrapper.vhd_source │ ├── ip │ │ └── create_action_ip.tcl │ ├── sw │ │ ├── Makefile │ │ ├── snap_example.c │ │ └── snap_example.h │ └── tests │ │ └── hw_test.sh ├── hdl_multi_process │ ├── Makefile │ ├── hw │ │ ├── Makefile │ │ ├── action_config.sh │ │ ├── engines │ │ │ └── memcopy │ │ │ │ ├── action_memcopy.v │ │ │ │ ├── addr_send_channel.v │ │ │ │ ├── axi_lite_slave.v │ │ │ │ ├── axi_master_rd.v │ │ │ │ ├── axi_master_wr.v │ │ │ │ ├── ram_single_port.v │ │ │ │ ├── rd_result_check_channel.v │ │ │ │ └── wr_data_send_channel.v │ │ ├── framework │ │ │ ├── action_multi_process.v │ │ │ ├── action_wrapper.v_source │ │ │ ├── axi_lite_global_slave.v │ │ │ ├── multi_process_completion.v │ │ │ ├── multi_process_control.v │ │ │ ├── multi_process_framework.v_source │ │ │ ├── multi_process_manager.v │ │ │ └── multi_process_scheduler.v │ │ └── tcl │ │ │ └── design.tcl │ ├── ip │ │ ├── Makefile │ │ ├── engines │ │ │ └── Makefile │ │ ├── framework │ │ │ └── Makefile │ │ └── tcl │ │ │ └── create_framework_ip.tcl │ └── sw │ │ ├── Makefile │ │ ├── hdl_multi_process.c │ │ └── hdl_multi_process.h ├── hdl_single_engine │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── action_config.sh │ │ ├── hdl │ │ │ ├── action_single_engine.v │ │ │ ├── action_wrapper.v │ │ │ ├── addr_send_channel.v │ │ │ ├── axi_lite_slave.v │ │ │ ├── axi_master_rd.v │ │ │ ├── axi_master_wr.v │ │ │ ├── ram_single_port.v │ │ │ ├── rd_result_check_channel.v │ │ │ └── wr_data_send_channel.v │ │ └── tcl │ │ │ └── example.tcl │ ├── ip │ │ └── create_action_ip.tcl │ ├── sw │ │ ├── Makefile │ │ ├── hdl_single_engine.c │ │ └── hdl_single_engine.h │ └── tests │ │ ├── hw_test.sh │ │ ├── hw_throughput_test.sh │ │ ├── process_bandwidth.awk │ │ └── process_variance.awk ├── hdl_unit_sim │ ├── Makefile │ ├── hw │ │ ├── Makefile │ │ ├── action_config.sh │ │ └── hdl │ │ │ ├── action_wrapper.v │ │ │ └── odma_dummy_action.v │ ├── ip │ │ └── create_action_ip.tcl │ └── sw │ │ ├── Makefile │ │ ├── hdl_unit_sim.c │ │ └── hdl_unit_sim.h ├── hls.mk ├── hls_decimal_mult │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── action_decimal_mult.H │ │ └── action_decimal_mult.cpp │ ├── include │ │ └── common_decimal.h │ ├── sw │ │ ├── Makefile │ │ ├── action_decimal_mult.c │ │ └── snap_decimal_mult.c │ └── tests │ │ └── hw_test.sh ├── hls_hbm_memcopy_1024 │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── hw_action_hbm_memcopy_1024.H │ │ └── hw_action_hbm_memcopy_1024.cpp │ ├── include │ │ └── action_memcopy.h │ ├── sw │ │ ├── Makefile │ │ └── snap_hbm_memcopy.c │ └── tests │ │ ├── clean.sh │ │ ├── hw_test.sh │ │ ├── hw_throughput_test.sh │ │ └── process.awk ├── hls_helloworld_1024 │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── action_uppercase.H │ │ └── action_uppercase.cpp │ ├── include │ │ └── action_changecase.h │ ├── sw │ │ ├── Makefile │ │ └── snap_helloworld_1024.c │ └── tests │ │ └── hw_test.sh ├── hls_helloworld_512 │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── action_uppercase.H │ │ └── action_uppercase.cpp │ ├── include │ │ └── action_changecase.h │ ├── sw │ │ ├── Makefile │ │ └── snap_helloworld_512.c │ └── tests │ │ └── hw_test.sh ├── hls_helloworld_python │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── action_uppercase.H │ │ └── action_uppercase.cpp │ ├── include │ │ └── action_changecase_python.h │ ├── sw │ │ ├── Makefile │ │ ├── commands_on_sim.txt │ │ ├── etc │ │ │ └── trieres.png │ │ ├── requirements.txt │ │ ├── snap_helloworld_python.c │ │ ├── snap_helloworld_python.i │ │ ├── trieres_helloworld.ipynb │ │ └── trieres_helloworld_cosim.ipynb │ └── tests │ │ └── hw_test.sh ├── hls_image_filter │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── action_pixel_filter.H │ │ └── action_pixel_filter.cpp │ ├── include │ │ ├── action_pixel_filtering.h │ │ └── tiger.h │ ├── sw │ │ ├── Makefile │ │ ├── apples.bmp │ │ ├── bmp.c │ │ ├── bmp.h │ │ ├── params.c │ │ ├── params.h │ │ ├── snap_image_filter.c │ │ ├── tiger.bmp │ │ ├── tiger_reference.bmp │ │ ├── tiger_small.bmp │ │ └── tiger_small_reference.bmp │ └── tests │ │ └── hw_test.sh ├── hls_memcopy_1024 │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── hw_action_memcopy_1024.H │ │ └── hw_action_memcopy_1024.cpp │ ├── include │ │ └── action_memcopy.h │ ├── sw │ │ ├── Makefile │ │ └── snap_memcopy.c │ └── tests │ │ ├── clean.sh │ │ ├── hw_test.sh │ │ ├── hw_throughput_test.sh │ │ └── process.awk ├── hls_memcopy_512 │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── hw_action_memcopy_512.H │ │ └── hw_action_memcopy_512.cpp │ ├── include │ │ └── action_memcopy.h │ ├── sw │ │ ├── Makefile │ │ └── snap_memcopy.c │ └── tests │ │ ├── clean.sh │ │ ├── hw_test.sh │ │ ├── hw_throughput_test.sh │ │ └── process.awk ├── hls_udp_512 │ ├── Makefile │ ├── README.md │ ├── hw │ │ ├── Makefile │ │ ├── README.md │ │ ├── action_test.h │ │ ├── eth_decode.cpp │ │ ├── hls_udp.cpp │ │ ├── hls_udp.h │ │ └── write_data.cpp │ ├── include │ │ └── action_udp.H │ ├── sw │ │ ├── Makefile │ │ └── oc-accel_udp.c │ └── tests │ │ └── hw_test.sh ├── include │ └── hls_snap_1024.H ├── scripts │ ├── create_run_hls_script.sh │ └── oc_jenkins.sh └── software.mk ├── check_ocse.sh ├── check_platform.sh ├── debug_timing ├── defconfig ├── OC-AD9H3.hdl_example.defconfig ├── OC-AD9H3.hdl_single_engine.defconfig ├── OC-AD9H3.hls_decimal_mult.defconfig ├── OC-AD9H3.hls_hbm_memcopy_1024.defconfig ├── OC-AD9H3.hls_helloworld_1024.defconfig ├── OC-AD9H3.hls_helloworld_512.defconfig ├── OC-AD9H3.hls_image_filter.defconfig ├── OC-AD9H3.hls_memcopy_1024.defconfig ├── OC-AD9H3.hls_udp_512.defconfig ├── OC-AD9H335.hdl_example.defconfig ├── OC-AD9H335.hdl_single_engine.defconfig ├── OC-AD9H335.hls_decimal_mult.defconfig ├── OC-AD9H335.hls_hbm_memcopy_1024.defconfig ├── OC-AD9H335.hls_helloworld_1024.defconfig ├── OC-AD9H335.hls_helloworld_512.defconfig ├── OC-AD9H335.hls_helloworld_python.defconfig ├── OC-AD9H335.hls_image_filter.defconfig ├── OC-AD9H335.hls_memcopy_1024.defconfig ├── OC-AD9H335.hls_udp_512.defconfig ├── OC-AD9H7.hdl_example.defconfig ├── OC-AD9H7.hdl_single_engine.defconfig ├── OC-AD9H7.hls_decimal_mult.defconfig ├── OC-AD9H7.hls_hbm_memcopy_1024.defconfig ├── OC-AD9H7.hls_helloworld_1024.defconfig ├── OC-AD9H7.hls_helloworld_512.defconfig ├── OC-AD9H7.hls_image_filter.defconfig ├── OC-AD9H7.hls_memcopy_1024.defconfig ├── OC-AD9H7.hls_udp_512.defconfig ├── OC-AD9V3.hdl_example.defconfig ├── OC-AD9V3.hdl_single_engine.defconfig ├── OC-AD9V3.hls_decimal_mult.defconfig ├── OC-AD9V3.hls_helloworld_1024.defconfig ├── OC-AD9V3.hls_helloworld_512.defconfig ├── OC-AD9V3.hls_helloworld_python.defconfig ├── OC-AD9V3.hls_image_filter.defconfig ├── OC-AD9V3.hls_memcopy_1024.defconfig ├── OC-AD9V3.hls_memcopy_512.defconfig ├── OC-BW250SOC.hdl_example.defconfig ├── OC-BW250SOC.hdl_single_engine.defconfig ├── OC-BW250SOC.hls_decimal_mult.defconfig ├── OC-BW250SOC.hls_helloworld_1024.defconfig ├── OC-BW250SOC.hls_helloworld_512.defconfig ├── OC-BW250SOC.hls_image_filter.defconfig ├── OC-BW250SOC.hls_memcopy_1024.defconfig ├── OC-BW250SOC.hls_memcopy_512.defconfig ├── README.md ├── hdl_unit_sim.bridge.defconfig ├── hdl_unit_sim.odma.defconfig ├── hdl_unit_sim.odma_mm_512.defconfig ├── hdl_unit_sim.odma_st_1024.defconfig └── hdl_unit_sim.odma_st_512.defconfig ├── display_traces ├── hardware ├── .gitignore ├── Makefile ├── README.md ├── hdl │ ├── core │ │ ├── .gitignore │ │ ├── framework_afu.v │ │ ├── oc_action_core.v │ │ ├── oc_function.v │ │ ├── oc_snap_core.v │ │ └── snap_global_vars.v_source │ ├── hls │ │ └── action_wrapper.v │ ├── nvme │ │ ├── nvme_buffer_ram.sv │ │ ├── nvme_defines.sv │ │ ├── nvme_host.sv │ │ ├── nvme_host_slave.sv │ │ ├── nvme_host_wrap.v │ │ ├── nvme_io_track.sv │ │ ├── nvme_pcie_master.sv │ │ └── nvme_pcie_slave.sv │ ├── oc │ │ ├── axi_lite_master.v │ │ ├── brdg_axi_slave.v │ │ ├── brdg_axi_slave_cmd_fifo.v │ │ ├── brdg_command_encode.v │ │ ├── brdg_context_surveil.v │ │ ├── brdg_data_bridge.v │ │ ├── brdg_interrupt.v │ │ ├── brdg_partial_sequencer.v │ │ ├── brdg_rd_order_mng_array.v │ │ ├── brdg_response_decode.v │ │ ├── brdg_retry_queue.v │ │ ├── brdg_tlx_cmd_converter.v │ │ ├── brdg_tlx_rsp_converter.v │ │ ├── brdg_wr_order_mng_array.v │ │ ├── brdg_wrapper.v │ │ ├── fifo_async.v │ │ ├── fifo_sync.v │ │ ├── mmio.v │ │ ├── mmio_wrapper.v │ │ ├── ram_simple_dual.v │ │ ├── ram_true_dual.v │ │ └── tlx_mmio_converter.v │ └── odma │ │ ├── README.md │ │ ├── odma.v │ │ ├── odma_a2h_mm_engine.v │ │ ├── odma_a2h_st_engine.v │ │ ├── odma_completion_manager.v │ │ ├── odma_defines.v │ │ ├── odma_descriptor_manager.v │ │ ├── odma_h2a_mm_engine.v │ │ ├── odma_h2a_st_engine.v │ │ ├── odma_lcl_rd_arbiter.v │ │ ├── odma_lcl_wr_arbiter.v │ │ ├── odma_registers.v │ │ └── odma_wrapper.v ├── setup │ ├── build_mcs.tcl │ ├── cov.ccf │ ├── create_eth_100G_ip.tcl │ ├── create_framework.tcl │ ├── create_hbm.tcl │ ├── create_hbm_for_simu.tcl │ ├── create_hls_ip.tcl │ ├── create_nvme_host.tcl │ ├── create_other_strategy_impls.tcl │ ├── create_snap_ip.tcl │ ├── export_irun.tcl │ ├── export_modelsim.tcl │ ├── export_questa.tcl │ ├── export_xcelium.tcl │ ├── export_xsim.tcl │ ├── flash_mcs.tcl │ ├── gen_probe_ltx.tcl │ ├── ila_example.xdc │ ├── oc_pr_image.tcl │ ├── oc_pr_route_action.tcl │ ├── oc_pr_route_static.tcl │ ├── oc_pr_synth_action.tcl │ ├── oc_pr_synth_static.tcl │ ├── patch_NVMe.sh │ ├── patch_sim.sh │ ├── patch_version.sh │ ├── snap_bitstream_step.tcl │ ├── snap_build.tcl │ ├── snap_cloud_build.tcl │ ├── snap_impl.xdc │ ├── snap_impl_step.tcl │ ├── snap_link.xdc │ ├── snap_synth_step.tcl │ ├── snap_timing.xdc │ ├── unit_sim.tcl │ └── util.tcl └── sim │ ├── README.md │ ├── debug3_action_gmem_ddr4.svwf │ ├── debug3_action_gmem_ddr4.wcfg │ ├── debug3_action_gmem_hbm.svwf │ ├── debug3_action_gmem_hbm.wcfg │ ├── fastest.parms │ ├── ncaet.tcl │ ├── ncrun.tcl │ ├── nvme │ ├── endp_4_pipe32.soma │ ├── nvme_model.v │ └── pcie_endp_model.v │ ├── nvme_lite │ ├── Makefile │ └── nvme_top_i.sv │ ├── pslse.parms │ ├── run_sim │ ├── shortlist.sh │ ├── testlist.sh │ ├── testlist_simple.sh │ ├── unit_verif │ ├── action_bfm │ │ ├── act_cfg_obj.sv │ │ ├── action_agent.sv │ │ ├── action_bfm_pkg.svh │ │ ├── action_seqr.sv │ │ ├── action_seqr_st.sv │ │ ├── axi_lite_slv_agent.sv │ │ ├── axi_mm_mst_agent.sv │ │ ├── axi_mm_slv_agent.sv │ │ ├── axi_st_mst_agent.sv │ │ └── axi_st_slv_agent.sv │ ├── env │ │ ├── action_tb_base_test.sv │ │ ├── action_tb_env.sv │ │ ├── action_tb_pkg.svh │ │ ├── action_tb_test_lib.sv │ │ ├── odma_test_lib.sv │ │ ├── odma_test_lib_st.sv │ │ └── tb_vseqr.sv │ ├── mon │ │ ├── axi_lite_monitor.sv │ │ ├── axi_mm_monitor.sv │ │ ├── axi_st_monitor.sv │ │ └── tlx_afu_monitor.sv │ ├── sb │ │ ├── bridge_check_scoreboard.sv │ │ ├── odma_check_scoreboard.sv │ │ └── odma_reg_defines.sv │ ├── tl_bfm │ │ ├── env │ │ │ ├── dlx_tlx_interface.sv │ │ │ └── tl_bfm_pkg.svh │ │ ├── sb │ │ │ ├── sb.svh │ │ │ ├── tl_mem_model.sv │ │ │ └── tl_scoreboard.sv │ │ ├── seq_lib │ │ │ ├── bfm_seq_lib.sv │ │ │ ├── bfm_seq_lib_mmio_intrp.sv │ │ │ ├── bfm_seq_lib_rand_axi.sv │ │ │ ├── bfm_seq_lib_rand_axi_resp.sv │ │ │ ├── bfm_seq_lib_rand_resp.sv │ │ │ ├── bfm_sequence_base.sv │ │ │ ├── odma_seq_lib.sv │ │ │ ├── odma_seq_lib_st.sv │ │ │ ├── odma_seq_lib_unalign.sv │ │ │ └── test_list.svh │ │ ├── tl │ │ │ ├── tl.svh │ │ │ ├── tl_agent.sv │ │ │ ├── tl_dl_if.sv │ │ │ ├── tl_rx_monitor.sv │ │ │ ├── tl_tx_driver.sv │ │ │ ├── tl_tx_monitor.sv │ │ │ └── tl_tx_seqr.sv │ │ └── util │ │ │ ├── dl_credit_trans.sv │ │ │ ├── host_mem_model.sv │ │ │ ├── tl_cfg_obj.sv │ │ │ ├── tl_manager.sv │ │ │ ├── tl_rx_trans.sv │ │ │ ├── tl_trans.sv │ │ │ ├── tl_tx_trans.sv │ │ │ └── util.svh │ └── util │ │ ├── afu_tlx_transaction.sv │ │ ├── axi_lite_transaction.sv │ │ ├── axi_mm_transaction.sv │ │ ├── axi_st_transaction.sv │ │ ├── brdg_cfg_obj.sv │ │ ├── intrp_interface.sv │ │ ├── intrp_transaction.sv │ │ ├── odma_desp_transaction.sv │ │ ├── tlx_afu_interface.sv │ │ └── tlx_afu_transaction.sv │ ├── xsaet.tcl │ └── xsrun.tcl ├── ocaccel_workflow.py ├── scripts ├── .gitignore ├── Kconfig ├── Makefile ├── full_regression_list ├── ide │ ├── configure.py │ ├── env_check.py │ ├── env_clean.py │ ├── make_cloud_action.py │ ├── make_cloud_base.py │ ├── make_image.py │ ├── make_model.py │ ├── ocaccel_utils.py │ ├── ocaccel_workflow.py │ ├── qa.py │ └── run_sim.py ├── jenkins_regression.sh ├── jenkins_sanity_image.ksh ├── jenkins_sanity_sim.ksh ├── odma_jenkins_regression.sh ├── odma_regression_list ├── parse_unit_sim_result.pl ├── regression_list ├── snap_cfg └── utils │ └── hdl_pp │ ├── README.md │ ├── eperl │ ├── plugins │ ├── EperlUtil.pm │ ├── assert.pm │ ├── eperl.pm │ ├── example │ ├── fifo.pm │ ├── flop.pm │ ├── pipe.pm │ ├── ram.pm │ └── retime.pm │ ├── pre_vcp │ └── vcp ├── setup_tools.ksh ├── snap_env ├── snap_path.sh └── software ├── Makefile ├── README.md ├── config.mk ├── include ├── libosnap.h ├── osnap_global_regs.h ├── osnap_hls_if.h ├── osnap_internal.h ├── osnap_queue.h ├── osnap_tools.h └── osnap_types.h ├── lib ├── Makefile └── osnap.c └── tools ├── .gitignore ├── Makefile ├── cfg_snap_actions.pl ├── cfg_snap_actions.sh ├── force_cpu.c ├── force_cpu.h ├── oc_find_card ├── oc_maint.c ├── simple_reg_access.c ├── simple_reg_access.sh ├── snap_peek.c ├── snap_poke.c └── soft_reset.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .snap* 2 | snap_env.sh 3 | software/*/*.o 4 | software/*/*.d 5 | software/*/*.so 6 | *.jou 7 | *.log 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "hardware/oc-bip"] 2 | path = hardware/oc-bip 3 | url = https://github.com/opencapi/OpenCAPI3.0_Client_RefDesign.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | language: c 4 | compiler: gcc 5 | before_install: 6 | - sudo apt-get -qq update 7 | - sudo apt-get --assume-yes install gcc help2man git make 8 | - wget http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/include/uapi/misc/cxl.h 9 | - sudo mkdir -p /usr/include/misc/ 10 | - sudo mv cxl.h /usr/include/misc/ 11 | - git clone https://github.com/ibm-capi/pslse ../pslse 12 | - make -C ../pslse/libcxl 13 | - sudo cp ../pslse/libcxl/libcxl.a /usr/lib 14 | - sudo cp ../pslse/libcxl/libcxl.h /usr/include 15 | script: 16 | - make 17 | - make test 18 | -------------------------------------------------------------------------------- /BugReporting.md: -------------------------------------------------------------------------------- 1 | # SNAP Framework Bug Reporting 2 | 3 | For bugs, questions or requests for enhancements, please use Github issues: 4 | https://github.com/open-power/snap/issues 5 | 6 | All issues should have one of the labels 7 | * `bug` 8 | * `question` 9 | * `enhancement` 10 | 11 | The default is normal priority. Add the `blocker` or `nice to have` labels for highest or lower priority. 12 | 13 | After opening an issue, assign it to people to work on, preferrably a single person. 14 | Once the assigned person has reviewed the issue, they can assign the `in progress` label to show that they are working on the issue. 15 | After fixing the issue, assign the `verify` label to indicate that the fix is ready for testing. Once testing completed successfully, the tester or originator of the issue close the issue again. 16 | In some cases the issue may be rejected because it is `invalid`, a `duplicate` of another issue, or it was decided `wont fix`, and closed. 17 | 18 | 19 | # SNAP Framework Bug Reporting Template 20 | 21 | Please make sure to include sufficient information in the bug to understand and recreate it. 22 | * Detailed instructions how to recreate the issue 23 | * Where applicable, also include 24 | * The SNAP design or bitstream version 25 | * Git SHA ID 26 | * Name of the release and/or branch 27 | * Configuration used during make config, e.g. DDR3_USED=TRUE 28 | * The accelerated action used and its version 29 | * In case of hardware issues, include 30 | * which FPGA card was used 31 | * the image name and where the tester can retrieve it 32 | * FPGA timing info, in particular negative slack 33 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Process For Accepting Third Party Code Contributions 2 | 3 | To improve tracking of contributions to this project we will use a 4 | process modeled on the modified DCO 1.1 and use a "sign-off" procedure 5 | on patches that are being emailed around or contributed in any other 6 | way. 7 | 8 | The sign-off is a simple line at the end of the explanation for the 9 | patch, which certifies that you wrote it or otherwise have the right 10 | to pass it on as an open-source patch. The rules are pretty simple: 11 | if you can certify the below: 12 | 13 | By making a contribution to this project, I certify that: 14 | 15 | (a) The contribution was created in whole or in part by me and I have 16 | the right to submit it under the open source license indicated in the 17 | file; or 18 | 19 | (b) The contribution is based upon previous work that, to the best of 20 | my knowledge, is covered under an appropriate open source License and 21 | I have the right under that license to submit that work with 22 | modifications, whether created in whole or in part by me, under the 23 | same open source license (unless I am permitted to submit under a 24 | different license), as indicated in the file; or 25 | 26 | (c) The contribution was provided directly to me by some other person 27 | who certified (a), (b) or (c) and I have not modified it. 28 | 29 | (d) The contribution is made free of any other party's intellectual 30 | property claims or rights. 31 | 32 | (e) I understand and agree that this project and the contribution are 33 | public and that a record of the contribution (including all personal 34 | information I submit with it, including my sign-off) is maintained 35 | indefinitely and may be redistributed consistent with this project or 36 | the open source license(s) involved. 37 | 38 | then you just add a line saying 39 | 40 | Signed-off-by: Random J Developer 41 | -------------------------------------------------------------------------------- /actions/.gitignore: -------------------------------------------------------------------------------- 1 | hdl_example/hw/action_example.vhd 2 | hdl_example/hw/action_wrapper.vhd -------------------------------------------------------------------------------- /actions/README.md: -------------------------------------------------------------------------------- 1 | # OC-Accel actions 2 | 3 | This subdirectory contains action examples and actions created by users. Each example consists of an application (in C) running on the host and an associated action (in Verilog/VHDL or in C/C++) being executed on the FPGA. 4 | 5 | Check for more information. 6 | -------------------------------------------------------------------------------- /actions/hdl_example/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hdl_example/README.md: -------------------------------------------------------------------------------- 1 | # This example is kept as is. It will be depricated soon. 2 | 3 | # OC-ACCEL HDL EXAMPLE 4 | 5 | The hdl_example is a multi function example. The hardware is written in VHDL, the software in C. 6 | 7 | ## Hardware 8 | The hardware part implements the following core functions: 9 | * A counter function 10 | * A function that copies data from and to the Host Memory 11 | * A function that copies data from and to the DDR Memory (on the FPGA Card) 12 | * A function that copies data from and to the NVMe 13 | * A set memory and check memory function 14 | 15 | Dependent on the OC-ACCEL configuration the necessary interfaces will be added to or removed from the action. 16 | 17 | ## Software 18 | * snap_example 19 | * Count down mode 20 | * Copy from Host Memory to Host Memory. 21 | * Copy from Host Memory to DDR Memory (FPGA Card). 22 | * Copy from DDR Memory (FPGA Card) to Host Memory. 23 | * Copy from DDR Memory to DDR Memory (both on FPGA Card). 24 | 25 | -------------------------------------------------------------------------------- /actions/hdl_example/doc/main_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hdl_example/doc/main_blocks.png -------------------------------------------------------------------------------- /actions/hdl_example/doc/top_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hdl_example/doc/top_blocks.png -------------------------------------------------------------------------------- /actions/hdl_example/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | vhd_srcs=$(wildcard *.vhd_source) 18 | vhd_files=$(vhd_srcs:.vhd_source=.vhd) 19 | 20 | .PHONY: all config clean vhdl 21 | 22 | all: config 23 | 24 | config: 25 | $(info Call action_config.sh (creating action IPs)) 26 | ./action_config.sh 27 | 28 | clean: 29 | # $(info Also clean up action ip project...) 30 | @$(RM) $(ACTION_ROOT)/ip/*.log 31 | @$(RM) $(ACTION_ROOT)/hw/*.log 32 | @$(RM) $(ACTION_ROOT)/ip/*.jou 33 | @$(RM) -fr $(ACTION_ROOT)/ip/action_ip_prj 34 | @$(RM) -fr $(ACTION_ROOT)/ip/ip_user_files 35 | @$(RM) $(vhd_files) 36 | 37 | vhdl: 38 | 39 | # 40 | # FIXME Consider moving the functionality from action_config.sh into 41 | # this Makefile. This also allows to define a proper clean rule 42 | # such that the directory gets properly cleaned up and git status 43 | # shows not the generated files. 44 | # 45 | -------------------------------------------------------------------------------- /actions/hdl_example/ip/create_action_ip.tcl: -------------------------------------------------------------------------------- 1 | 2 | ## Env Variables 3 | 4 | set action_root [lindex $argv 0] 5 | set fpga_part [lindex $argv 1] 6 | #set fpga_part xcvu9p-flgb2104-2l-e 7 | #set action_root ../ 8 | 9 | set aip_dir $action_root/ip 10 | set log_dir $action_root/../../hardware/logs 11 | set log_file $log_dir/create_action_ip.log 12 | set src_dir $aip_dir/action_ip_prj/action_ip_prj.srcs/sources_1/ip 13 | 14 | ## Create a new Vivado IP Project 15 | puts "\[CREATE_ACTION_IPs..........\] start [clock format [clock seconds] -format {%T %a %b %d/ %Y}]" 16 | puts " FPGACHIP = $fpga_part" 17 | puts " ACTION_ROOT = $action_root" 18 | puts " Creating IP in $src_dir" 19 | #create_project action_ip_prj $aip_dir/action_ip_prj -force -part $fpga_part -ip >> $log_file 20 | # 21 | ## Project IP Settings 22 | ## General 23 | #puts " Generating axi_dwidth_converter ......" 24 | #create_ip -name axi_dwidth_converter -vendor xilinx.com -library ip -version 2.1 -module_name axi_dwidth_converter_0 >> $log_file 25 | #set_property -dict [list CONFIG.ADDR_WIDTH {64} CONFIG.SI_DATA_WIDTH {512} CONFIG.MI_DATA_WIDTH {1024}] [get_ips axi_dwidth_converter_0] 26 | # 27 | #generate_target all [get_files $src_dir/axi_dwidth_converter_0/axi_dwidth_converter_0.xci] >> $log_file 28 | # 29 | #close_project 30 | puts "\[CREATE_ACTION_IPs..........\] done [clock format [clock seconds] -format {%T %a %b %d %Y}]" 31 | -------------------------------------------------------------------------------- /actions/hdl_example/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # This is solution specific. Check if we can replace this by generics too. 29 | 30 | # Finding $SNAP_ROOT 31 | ifndef SNAP_ROOT 32 | # check if we are in sw folder of an action (three directories below snap root) 33 | ifneq ("$(wildcard ../../../actions)","") 34 | SNAP_ROOT=$(abspath ../../../) 35 | else 36 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 37 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 38 | endif 39 | endif 40 | 41 | projs += snap_example 42 | 43 | # If you have the host code outside of the default snap directory structure, 44 | # change to /path/to/snap/actions/software.mk 45 | include $(SNAP_ROOT)/actions/software.mk 46 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw clean ip 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | #vhd_srcs=$(wildcard *.vhd_source) 18 | #vhd_files=$(vhd_srcs:.vhd_source=.vhd) 19 | 20 | .PHONY: all config clean vhdl 21 | 22 | all: config 23 | 24 | config: 25 | ./action_config.sh 26 | 27 | clean: 28 | @$(RM) $(vhd_files) 29 | 30 | vhdl: 31 | 32 | # 33 | # FIXME Consider moving the functionality from action_config.sh into 34 | # this Makefile. This also allows to define a proper clean rule 35 | # such that the directory gets properly cleaned up and git status 36 | # shows not the generated files. 37 | # 38 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/hw/engines/memcopy/ram_single_port.v: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `timescale 1ns/1ps 17 | 18 | module ram_single_port (clk, we, addr, data_in, data_out); 19 | 20 | parameter DATA_WIDTH = 8; 21 | parameter ADDR_WIDTH = 5; 22 | parameter DEPTH = 2**ADDR_WIDTH; 23 | 24 | input clk, we; 25 | input [ADDR_WIDTH-1:0] addr; 26 | input [DATA_WIDTH-1:0] data_in; 27 | output [DATA_WIDTH-1:0] data_out; 28 | 29 | reg [DATA_WIDTH-1:0] ram [DEPTH-1:0]; 30 | 31 | reg [ADDR_WIDTH-1:0] addr_reg; 32 | integer i; 33 | initial for (i=0; i> $log_file 11 | export_ip_user_files -of_objects [get_files "$ip_xci"] -no_script -sync -force >> $log_file 12 | } 13 | 14 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/ip/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += framework engines 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/ip/engines/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += regex 18 | 19 | .PHONY: clean 20 | 21 | # Cleanup for all subdirectories. 22 | # Only dive into subdirectory if existent and if Makefile is there. 23 | clean: 24 | @for dir in $(subdirs); do \ 25 | if [ -d $$dir -a -d $$dir/managed_ip_project ]; then \ 26 | cd $$dir; find . -maxdepth 1 -type d ! -path '.' -print -exec rm -r {} \;; \ 27 | fi \ 28 | done 29 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/ip/framework/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | .PHONY: clean 18 | 19 | # Cleanup for all subdirectories. 20 | # Only dive into subdirectory if existent and if Makefile is there. 21 | clean: 22 | @if [ -d ./framework_ip_prj ]; then \ 23 | rm -rf framework_ip_prj || exit 1; \ 24 | fi 25 | -------------------------------------------------------------------------------- /actions/hdl_multi_process/sw/hdl_multi_process.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __HDL_MULTI_PROCESS__ 18 | #define __HDL_MULTI_PROCESS__ 19 | 20 | /* 21 | * This makes it obvious that we are influenced by HLS details ... 22 | * The ACTION control bits are defined in the following file. 23 | */ 24 | #define ACTION_TYPE 0x1014200E 25 | #define RELEASE_LEVEL 0x00000001 26 | 27 | #define REG_SNAP_CONTROL 0x00 28 | #define REG_SNAP_INT_ENABLE 0x04 29 | #define REG_SNAP_ACTION_TYPE 0x10 30 | #define REG_SNAP_ACTION_VERSION 0x14 31 | #define REG_SNAP_CONTEXT 0x20 32 | #define REG_MP_CONTROL 0x24 33 | #define REG_MP_INIT_ADDR_LO 0x28 34 | #define REG_MP_INIT_ADDR_HI 0x2C 35 | #define REG_MP_CMPL_ADDR_LO 0x30 36 | #define REG_MP_CMPL_ADDR_HI 0x34 37 | 38 | #endif /* __HDL_MULTI_PROCESS__ */ 39 | -------------------------------------------------------------------------------- /actions/hdl_single_engine/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hdl_single_engine/README.md: -------------------------------------------------------------------------------- 1 | # HDL_SINGLE_BRIDGE 2 | 3 | The purpose of this test includes: 4 | * Run on hardware 5 | * Use four Time Trace RAMs to do latency test. Which will record the cycle when AXI READ and WRITE transactions are sent and received. 6 | * AXI Length/Size combination test 7 | * Multiple AXI ID test 8 | * Throughput test for oc-accel bridge 9 | 10 | For the detailed usage, please go to "sw/hdl_single_engine.c", Usage() function. 11 | -------------------------------------------------------------------------------- /actions/hdl_single_engine/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | #vhd_srcs=$(wildcard *.vhd_source) 18 | #vhd_files=$(vhd_srcs:.vhd_source=.vhd) 19 | 20 | .PHONY: all config clean vhdl 21 | 22 | all: config 23 | 24 | config: 25 | $(info Call action_config.sh (creating action IPs)) 26 | ./action_config.sh 27 | 28 | clean: 29 | # $(info Also clean up action ip project...) 30 | @$(RM) $(ACTION_ROOT)/ip/*.log 31 | @$(RM) $(ACTION_ROOT)/ip/*.jou 32 | @$(RM) -fr $(ACTION_ROOT)/ip/action_ip_prj 33 | @$(RM) -fr $(ACTION_ROOT)/ip/ip_user_files 34 | @$(RM) $(vhd_files) 35 | 36 | vhdl: 37 | 38 | # 39 | # FIXME Consider moving the functionality from action_config.sh into 40 | # this Makefile. This also allows to define a proper clean rule 41 | # such that the directory gets properly cleaned up and git status 42 | # shows not the generated files. 43 | # 44 | -------------------------------------------------------------------------------- /actions/hdl_single_engine/hw/action_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Copyright 2019 International Business Machines 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## 17 | 18 | # Some addtional code generation or automation taks can be put here. 19 | echo " action config says ACTION_ROOT is $ACTION_ROOT" 20 | echo " action config says FPGACHIP is $FPGACHIP" 21 | 22 | if [ ! -d $ACTION_ROOT/ip/action_ip_dir ]; then 23 | echo " Call create_action_ip.tcl to generate IPs" 24 | vivado -mode batch -source $ACTION_ROOT/ip/create_action_ip.tcl -notrace -nojournal -tclargs $ACTION_ROOT $FPGACHIP 25 | fi 26 | -------------------------------------------------------------------------------- /actions/hdl_single_engine/hw/hdl/ram_single_port.v: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `timescale 1ns/1ps 17 | 18 | module ram_single_port (clk, we, addr, data_in, data_out); 19 | 20 | parameter DATA_WIDTH = 8; 21 | parameter ADDR_WIDTH = 5; 22 | parameter DEPTH = 2**ADDR_WIDTH; 23 | 24 | input clk, we; 25 | input [ADDR_WIDTH-1:0] addr; 26 | input [DATA_WIDTH-1:0] data_in; 27 | output [DATA_WIDTH-1:0] data_out; 28 | 29 | reg [DATA_WIDTH-1:0] ram [DEPTH-1:0]; 30 | 31 | reg [ADDR_WIDTH-1:0] addr_reg; 32 | integer i; 33 | initial for (i=0; i> $log_file 20 | 21 | ## Project IP Settings 22 | ## General 23 | # create_ip -name ila -vendor xilinx.com -library ip -version 6.2 -module_name ila_p157 -dir $src_dir >> $log_file 24 | # set_property -dict [list CONFIG.C_PROBE0_WIDTH 157 CONFIG.C_DATA_DEPTH 2048 CONFIG.C_TRIGOUT_EN {false} CONFIG.C_TRIGIN_EN {false}] [get_ips ila_p157] 25 | # set_property generate_synth_checkpoint false [get_files $src_dir/ila_p157/ila_p157.xci] 26 | # generate_target {instantiation_template} [get_files $src_dir/ila_p157/ila_p157.xci] >> $log_file 27 | # generate_target all [get_files $src_dir/ila_p157/ila_p157.xci] >> $log_file 28 | 29 | 30 | close_project 31 | puts "\[CREATE_ACTION_IPs..........\] done [clock format [clock seconds] -format {%T %a %b %d %Y}]" 32 | -------------------------------------------------------------------------------- /actions/hdl_single_engine/tests/process_bandwidth.awk: -------------------------------------------------------------------------------- 1 | #! /usr/bin/awk -f 2 | 3 | #Process following string 4 | #memcopy of 512 bytes took 18 usec @ 28.444 MiB/sec (from HOST_DRAM to FPGA_BRAM) 5 | 6 | BEGIN { 7 | FS=" " 8 | a1_iter=0 9 | a2_iter=0 10 | a3_iter=0 11 | } 12 | { 13 | # print $0 14 | if ($0 ~ "Read average bandwidth") { 15 | a1_iter++ 16 | a1_size[a1_iter]=$5 17 | a1_usec[a1_iter]=$8 18 | a1_bw[a1_iter]=$11 19 | } 20 | if ($0 ~ "Write average bandwidth") { 21 | a2_iter++ 22 | a2_size[a2_iter]=$5 23 | a2_usec[a2_iter]=$8 24 | a2_bw[a2_iter]=$11 25 | } 26 | if ($0 ~ "Duplex average bandwidth") { 27 | a3_iter++ 28 | a3_size[a3_iter]=$4 29 | a3_usec[a3_iter]=$7 30 | a3_bw[a3_iter]=$10 31 | } 32 | } 33 | END { 34 | i=1 35 | printf "+-------------------------------------------------------------------------------+\n" 36 | printf "| OC-Accel hdl_single_engine Throughput (MBytes/s) |\n" 37 | printf "+-------------------------------------------------------------------------------+\n" 38 | printf "|%11s %17s %17s %17s |\n","Total Bytes", "Read Bandwidth", "Write Bandwidth","Duplex Bandwidth" 39 | printf "+-------------------------------------------------------------------------------+\n" 40 | while (i <= a1_iter) { 41 | printf " %12s %17s %17s %17s \n",a1_size[i], a1_bw[i], a2_bw[i], a3_bw[i] 42 | i++ 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /actions/hdl_unit_sim/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hdl_unit_sim/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | #vhd_srcs=$(wildcard *.vhd_source) 18 | #vhd_files=$(vhd_srcs:.vhd_source=.vhd) 19 | 20 | .PHONY: all config clean vhdl 21 | 22 | all: config 23 | 24 | config: 25 | $(info Call action_config.sh (creating action IPs)) 26 | ./action_config.sh 27 | 28 | clean: 29 | # $(info Also clean up action ip project...) 30 | @$(RM) $(ACTION_ROOT)/hw/*.log 31 | @$(RM) $(ACTION_ROOT)/ip/*.log 32 | @$(RM) $(ACTION_ROOT)/ip/*.jou 33 | @$(RM) -fr $(ACTION_ROOT)/ip/action_ip_prj 34 | @$(RM) -fr $(ACTION_ROOT)/ip/ip_user_files 35 | @$(RM) $(vhd_files) 36 | 37 | vhdl: 38 | 39 | # 40 | # FIXME Consider moving the functionality from action_config.sh into 41 | # this Makefile. This also allows to define a proper clean rule 42 | # such that the directory gets properly cleaned up and git status 43 | # shows not the generated files. 44 | # 45 | -------------------------------------------------------------------------------- /actions/hdl_unit_sim/hw/action_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Copyright 2019 International Business Machines 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## 17 | 18 | # Some addtional code generation or automation taks can be put here. 19 | echo " action config says ACTION_ROOT is $ACTION_ROOT" 20 | echo " action config says FPGACHIP is $FPGACHIP" 21 | 22 | if [ ! -d $ACTION_ROOT/ip/action_ip_dir ]; then 23 | echo " Call create_action_ip.tcl to generate IPs" 24 | vivado -mode batch -source $ACTION_ROOT/ip/create_action_ip.tcl -notrace -nojournal -tclargs $ACTION_ROOT $FPGACHIP 25 | fi 26 | -------------------------------------------------------------------------------- /actions/hdl_unit_sim/sw/hdl_unit_sim.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | int main () 21 | { 22 | printf ("HDL UNIT SIM Dummy!"); 23 | return 1; 24 | } 25 | -------------------------------------------------------------------------------- /actions/hdl_unit_sim/sw/hdl_unit_sim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __hdl_unit_sim__ 18 | #define __hdl_unit_sim__ 19 | 20 | #endif /* __hdl_unit_sim__ */ 21 | -------------------------------------------------------------------------------- /actions/hls_decimal_mult/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_decimal_mult/README.md: -------------------------------------------------------------------------------- 1 | # HLS_DECIMAL_MULT EXAMPLE 2 | 3 | * Provides a simple base allowing to discover how to exchange ***single precision floating points (float) or double precision floating points (double)*** between the application on server and the action in the FPGA. 4 | * C code is multiplying 3 decimal numbers read from host memory and writing result in host memory 5 | * Detailed documentation is available at : 6 | -------------------------------------------------------------------------------- /actions/hls_decimal_mult/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../ActionTypes.md)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= decimal_mult 41 | SOLUTION_DIR ?= hlsDecimalMult 42 | srcs += action_decimal_mult.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_decimal_mult/hw/action_decimal_mult.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_DECIMAL_MULT_H__ 2 | #define __ACTION_DECIMAL_MULT_H__ 3 | 4 | /* 5 | * Copyright 2020 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* DecimalMult Job definition */ 26 | 27 | #define MAX_NB_OF_WORDS_READ (MAX_NB_OF_DECIMAL_READ*sizeof(mat_elmt_t)/BPERDW_512) // =2 if double =1 if float 28 | #define MAX_NB_OF_DECIMAL_PERDW (BPERDW_512/sizeof(mat_elmt_t)) // =8 if double =16 if float 29 | 30 | typedef char word_t[BPERDW_512]; 31 | //--------------------------------------------------------------------- 32 | typedef struct { 33 | CONTROL Control; /* 16 bytes */ 34 | decimal_mult_job_t Data; /* up to 108 bytes */ 35 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(decimal_mult_job_t)]; 36 | } action_reg; 37 | 38 | #endif /* __ACTION_DECIMAL_MULT_H__*/ 39 | -------------------------------------------------------------------------------- /actions/hls_decimal_mult/include/common_decimal.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMMON_DECIMAL_H__ 2 | #define __COMMON_DECIMAL_H__ 3 | 4 | /* 5 | * Copyright 2020 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #define ACTION_TYPE 0x1014300F 27 | #define RELEASE_LEVEL 0x00000010 28 | 29 | typedef struct decimal_mult_job { 30 | struct snap_addr in; /* input data */ 31 | struct snap_addr out; /* offset table */ 32 | } decimal_mult_job_t; 33 | 34 | #define MAX_NB_OF_DECIMAL_READ 16 35 | typedef float mat_elmt_t; // change to float or double depending on your needs 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif /* __COMMON_DECIMAL_H__*/ 42 | -------------------------------------------------------------------------------- /actions/hls_decimal_mult/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../ActionTypes.md)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | 41 | #snap_decimal_mult: action_decimal_mult.o 42 | #snap_decimal_mult_objs = action_decimal_mult.o 43 | 44 | projs += snap_decimal_mult 45 | 46 | # If you have the host code outside of the default snap directory structure, 47 | # change to /path/to/snap/actions/software.mk 48 | include $(SNAP_ROOT)/actions/software.mk 49 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/README.md: -------------------------------------------------------------------------------- 1 | # HLS_HBM_MEMCOPY EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL 4 | * C code allows copying to/from : 5 | * HOST memory (for example a file) 6 | * HBM memory on the FPGA board 7 | * Block RAM memory (memory inside the FPGA itself) 8 | * The example code details the copy mechanism. 9 | 10 | :star: * Detailed documentation is available at : 11 | 12 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= hbm_memcopy 41 | SOLUTION_DIR ?= hlsHBMMemcopy 42 | srcs += hw_action_hbm_memcopy_1024.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/hw/hw_action_hbm_memcopy_1024.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_HLS_HBM_MEMCOPY_H__ 2 | #define __ACTION_HLS_HBM_MEMCOPY_H__ 3 | 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* Memcopy Job definition */ 26 | 27 | 28 | #define MAX_NB_OF_BYTES_READ (128 * 1024) 29 | #define LCL_MEM_MAX_SIZE (256 * 1024 * 1024) // HBM is 256MB each 30 | #define MAX_NB_OF_WORDS_READ_256 (MAX_NB_OF_BYTES_READ/BPERDW_256) 31 | #define MAX_NB_OF_WORDS_READ_512 (MAX_NB_OF_BYTES_READ/BPERDW_512) 32 | #define MAX_NB_OF_WORDS_READ_1024 (MAX_NB_OF_BYTES_READ/BPERDW_1024) 33 | 34 | //--------------------------------------------------------------------- 35 | typedef struct { 36 | CONTROL Control; /* 16 bytes */ 37 | memcopy_job_t Data; /* up to 108 bytes */ 38 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(memcopy_job_t)]; 39 | } action_reg; 40 | 41 | #endif /* __ACTION_HLS_HBM_MEMCOPY_H__ */ 42 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | 41 | #snap_hbm_memcopy_objs = sw_action_memcopy.o 42 | snap_hbm_memcopy: ${snap_hbm_memcopy_objs} 43 | snap_hbm_memcopy_libs = -lm 44 | 45 | projs += snap_hbm_memcopy 46 | 47 | # If you have the host code outside of the default snap directory structure, 48 | # change to /path/to/snap/actions/software.mk 49 | include $(SNAP_ROOT)/actions/software.mk 50 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/tests/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f *.log *.bin *.out 3 | -------------------------------------------------------------------------------- /actions/hls_hbm_memcopy_1024/tests/process.awk: -------------------------------------------------------------------------------- 1 | #! /usr/bin/awk -f 2 | 3 | #Process following string 4 | #memcopy of 512 bytes took 18 usec @ 28.444 MiB/sec (from HOST_DRAM to FPGA_BRAM) 5 | 6 | BEGIN { 7 | FS=" " 8 | } 9 | { 10 | # print $0 11 | if ($0 ~ "HOST_DRAM to FPGA_BRAM") { 12 | a1_iter++ 13 | a1_size[a1_iter]=$3 14 | a1_usec[a1_iter]=$6 15 | a1_bw[a1_iter]=$9 16 | } 17 | if ($0 ~ "FPGA_BRAM to HOST_DRAM") { 18 | a2_iter++ 19 | a2_size[a2_iter]=$3 20 | a2_usec[a2_iter]=$6 21 | a2_bw[a2_iter]=$9 22 | } 23 | if ($0 ~ "HBM_P0 to FPGA_BRAM") { 24 | a3_iter++ 25 | a3_size[a3_iter]=$3 26 | a3_usec[a3_iter]=$6 27 | a3_bw[a3_iter]=$9 28 | } 29 | if ($0 ~ "FPGA_BRAM to HBM_P0") { 30 | a4_iter++ 31 | a4_size[a4_iter]=$3 32 | a4_usec[a4_iter]=$6 33 | a4_bw[a4_iter]=$9 34 | } 35 | } 36 | END { 37 | i=1 38 | printf "+-------------------------------------------------------------------------------+\n" 39 | printf "| OC-Accel hls_hbm_memcopy_1024 Throughput (MBytes/s) |\n" 40 | printf "+-------------------------------------------------------------------------------+\n" 41 | printf "%12s %16s %16s %16s %16s\n","bytes", "Host->FPGA_RAM", "FPGA_RAM->Host","FPGA(HBM->RAM)", "FPGA(RAM->HBM)" 42 | printf " -------------------------------------------------------------------------------\n" 43 | while (i <= a1_iter) { 44 | printf "%12s %16s %16s %16s %16s\n",a1_size[i], a1_bw[i], a2_bw[i], a3_bw[i], a4_bw[i] 45 | i++ 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /actions/hls_helloworld_1024/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_helloworld_1024/README.md: -------------------------------------------------------------------------------- 1 | # HLS_HELLOWORLD_1024 EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL 4 | * C code is changing characters case of a user phrase 5 | * code can be executed on the CPU (will transform all characters to lower case) 6 | * code can be simulated (will transform all characters to upper case in simulation) 7 | * code can then run in hardware when the FPGA is programmed (will transform all characters to upper case in hardware) 8 | * The example code uses the copy mechanism to get/put the file from/to system host memory to/from DDR FPGA attached memory 9 | 10 | :star: * Detailed documentation is available at : 11 | 12 | -------------------------------------------------------------------------------- /actions/hls_helloworld_1024/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= helloworld 41 | SOLUTION_DIR ?= hlsUpperCase 42 | srcs += action_uppercase.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_helloworld_1024/hw/action_uppercase.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_UPPERCASE_H__ 2 | #define __ACTION_UPPERCASE_H__ 3 | 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* HelloWorld Job definition */ 26 | 27 | 28 | typedef char word_t[BPERDW_1024]; 29 | //--------------------------------------------------------------------- 30 | // This is generic. Just adapt names for a new action 31 | // CONTROL is defined and handled by SNAP 32 | // helloworld_1024_job_t is user defined in hls_helloworld_1024/include/action_change_case.h 33 | typedef struct { 34 | CONTROL Control; /* 16 bytes */ 35 | helloworld_1024_job_t Data; /* up to 108 bytes */ 36 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(helloworld_1024_job_t)]; 37 | } action_reg; 38 | 39 | #endif /* __ACTION_UPPERCASE_H__*/ 40 | -------------------------------------------------------------------------------- /actions/hls_helloworld_1024/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | 41 | #snap_helloworld_1024_objs = action_lowercase.o 42 | snap_helloworld_1024: ${snap_helloworld_1024_objs} 43 | 44 | projs += snap_helloworld_1024 45 | 46 | # If you have the host code outside of the default snap directory structure, 47 | # change to /path/to/snap/actions/software.mk 48 | include $(SNAP_ROOT)/actions/software.mk 49 | -------------------------------------------------------------------------------- /actions/hls_helloworld_512/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_helloworld_512/README.md: -------------------------------------------------------------------------------- 1 | # HLS_HELLOWORLD_512 EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL 4 | * C code is changing characters case of a user phrase 5 | * code can be executed on the CPU (will transform all characters to lower case) 6 | * code can be simulated (will transform all characters to upper case in simulation) 7 | * code can then run in hardware when the FPGA is programmed (will transform all characters to upper case in hardware) 8 | * The example code uses the copy mechanism to get/put the file from/to system host memory to/from DDR FPGA attached memory 9 | 10 | :star: * Detailed documentation is available at : 11 | -------------------------------------------------------------------------------- /actions/hls_helloworld_512/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= helloworld 41 | SOLUTION_DIR ?= hlsUpperCase 42 | srcs += action_uppercase.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_helloworld_512/hw/action_uppercase.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_UPPERCASE_H__ 2 | #define __ACTION_UPPERCASE_H__ 3 | 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | /* Note that OC-ACCEL introduces the 1024 bit bus possibility */ 25 | /* hls_snap_1024.H covers both legacy 512 as well as 1024 cases */ 26 | #include "hls_snap_1024.H" 27 | #include /* HelloWorld Job definition */ 28 | 29 | 30 | typedef char word_t[BPERDW_512]; 31 | //--------------------------------------------------------------------- 32 | // This is generic. Just adapt names for a new action 33 | // CONTROL is defined and handled by OC-Accel 34 | // helloworld_512_job_t is user defined in hls_helloworld_512/include/action_change_case.h 35 | typedef struct { 36 | CONTROL Control; /* 16 bytes */ 37 | helloworld_512_job_t Data; /* up to 108 bytes */ 38 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(helloworld_512_job_t)]; 39 | } action_reg; 40 | 41 | #endif /* __ACTION_UPPERCASE_H__*/ 42 | -------------------------------------------------------------------------------- /actions/hls_helloworld_512/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | 41 | #snap_helloworld_512_objs = action_lowercase.o 42 | snap_helloworld_512: ${snap_helloworld_512_objs} 43 | 44 | projs += snap_helloworld_512 45 | 46 | # If you have the host code outside of the default snap directory structure, 47 | # change to /path/to/snap/actions/software.mk 48 | include $(SNAP_ROOT)/actions/software.mk 49 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/README.md: -------------------------------------------------------------------------------- 1 | # HLS_HELLOWORLD_PYTHON EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL 4 | * Python code is changing characters case of a user phrase using a FPGA to do the change 5 | * Detailed documentation is available at : 6 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= helloworld 41 | SOLUTION_DIR ?= hlsUpperCase 42 | srcs += action_uppercase.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/hw/action_uppercase.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_UPPERCASE_H__ 2 | #define __ACTION_UPPERCASE_H__ 3 | 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* HelloWorld Job definition */ 26 | 27 | 28 | typedef char word_t[BPERDW_1024]; 29 | //--------------------------------------------------------------------- 30 | // This is generic. Just adapt names for a new action 31 | // CONTROL is defined and handled by SNAP 32 | // helloworld_job_t is user defined in hls_helloworld/include/action_change_case.h 33 | typedef struct { 34 | CONTROL Control; /* 16 bytes */ 35 | helloworldp_job_t Data; /* up to 108 bytes */ 36 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(helloworldp_job_t)]; 37 | } action_reg; 38 | 39 | #endif /* __ACTION_UPPERCASE_H__*/ 40 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/sw/commands_on_sim.txt: -------------------------------------------------------------------------------- 1 | oc_maint -vvv 2 | 3 | LD_LIBRARY_PATH=$OCSE_ROOT/libocxl/ python3 4 | #LD_LIBRARY_PATH=/home/did/projects/ocse/libocxl/ python3 5 | 6 | import sys 7 | import os 8 | 9 | #sys.path.append("/home/did/projects/oc-accel_did/actions/hls_helloworld_python/sw") 10 | 11 | snap_action_sw=os.environ['SNAP_ROOT'] + "/actions/hls_helloworld_python/sw" 12 | print(snap_action_sw) 13 | sys.path.append(snap_action_sw) 14 | 15 | import snap_helloworld_python 16 | 17 | input = "Hello world. This is my first CAPI SNAP experience with Python. It's extremely fun" 18 | output = "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111" 19 | 20 | #snap_helloworld_python.uppercase(input, output) 21 | out, output = snap_helloworld_python.uppercase(input) 22 | 23 | print("Output from FPGA:"+output) 24 | 25 | print("Output from CPU :"+input.upper()) 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | Jupyter 36 | 37 | oc_maint -vvv 38 | 39 | cp -r ../../../../actions/hls_helloworld_python/sw/* . 40 | 41 | jupyter notebook trieres_helloworld_cosim.ipynb 42 | 43 | (then follow instrunctions on notebook: Select every cell and run it with Ctrl+D) 44 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/sw/etc/trieres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hls_helloworld_python/sw/etc/trieres.png -------------------------------------------------------------------------------- /actions/hls_helloworld_python/sw/requirements.txt: -------------------------------------------------------------------------------- 1 | attrs==19.3.0 2 | backcall==0.1.0 3 | bleach==3.3.0 4 | certifi==2023.7.22 5 | chardet==3.0.4 6 | decorator==4.4.2 7 | defusedxml==0.6.0 8 | entrypoints==0.3 9 | idna==3.7 10 | importlib-metadata==1.6.0 11 | ipykernel==5.2.1 12 | ipython==8.10.0 13 | ipython-genutils==0.2.0 14 | ipywidgets==7.5.1 15 | jedi==0.17.0 16 | Jinja2==3.1.4 17 | json5==0.9.4 18 | jsonschema==3.2.0 19 | jupyter==1.0.0 20 | jupyter-client==6.1.3 21 | jupyter-console==6.1.0 22 | jupyter-core==4.11.2 23 | jupyterlab==3.6.7 24 | jupyterlab-server==1.1.3 25 | MarkupSafe==1.1.1 26 | mistune==2.0.3 27 | nbconvert==6.5.1 28 | nbformat==5.0.6 29 | notebook==6.4.12 30 | packaging==20.3 31 | pandocfilters==1.4.2 32 | parso==0.7.0 33 | pexpect==4.8.0 34 | pickleshare==0.7.5 35 | pkg-resources==0.0.0 36 | prometheus-client==0.7.1 37 | prompt-toolkit==2.0.10 38 | ptyprocess==0.6.0 39 | Pygments==2.15.0 40 | pyparsing==2.4.7 41 | pyrsistent==0.16.0 42 | python-config==0.1.2 43 | python-dateutil==2.8.1 44 | pyzmq==19.0.1 45 | qtconsole==4.7.3 46 | QtPy==1.9.0 47 | requests==2.32.0 48 | Send2Trash==1.5.0 49 | six==1.14.0 50 | terminado==0.8.3 51 | testpath==0.4.4 52 | tornado==6.3.3 53 | traitlets==4.3.3 54 | urllib3==1.26.18 55 | wcwidth==0.1.9 56 | webencodings==0.5.1 57 | widgetsnbextension==3.5.1 58 | zipp==1.2.0 59 | -------------------------------------------------------------------------------- /actions/hls_helloworld_python/sw/snap_helloworld_python.i: -------------------------------------------------------------------------------- 1 | /* snap_helloworld_python.i */ 2 | %module snap_helloworld_python 3 | %include "cstring.i" 4 | %cstring_bounded_output(char *output_str, 1024); 5 | %{ 6 | /* Put header files here or function declarations like below */ 7 | extern int uppercase(char *input_str, char *output_str); 8 | %} 9 | extern int uppercase(char *input_str, char *output_str); 10 | -------------------------------------------------------------------------------- /actions/hls_image_filter/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_image_filter/README.md: -------------------------------------------------------------------------------- 1 | # HLS_IMAGE_FILTER EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL. 4 | * C code is processing a bmp image and grayes pixels when they contain enough red component. 5 | * More detailed documentation is available at 6 | -------------------------------------------------------------------------------- /actions/hls_image_filter/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../ActionTypes.md)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= image_filtering 41 | SOLUTION_DIR ?= hlsPixelfilter 42 | srcs += action_pixel_filter.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_image_filter/hw/action_pixel_filter.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_PIXEL_FILTER_H__ 2 | #define __ACTION_PIXEL_FILTER_H__ 3 | 4 | /* 5 | * Copyright 2020 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* action struture definition */ 26 | 27 | #define PATTERN_SIZE BPERDW_1024 28 | #define CARD_DRAM_SIZE (1 * 1024 *1024 * 1024) //Maximum size in bytes (depends on the card used) 29 | #define MAX_NB_OF_BYTES_READ (4 * 1024) 30 | #define MAX_NB_OF_WORDS_READ MAX_NB_OF_BYTES_READ/BPERDW_1024 31 | 32 | typedef char word_t[BPERDW_1024]; 33 | typedef snapu64_t address_t; 34 | 35 | #define PATTERN_SIZE BPERDW_1024 36 | #define TEXT_SIZE 4096 * MAX_NB_OF_BYTES_READ // used for streaming only 37 | 38 | typedef char word_t[BPERDW_1024]; 39 | //--------------------------------------------------------------------- 40 | // This is generic. Just adapt names for a new action 41 | // CONTROL is defined and handled by OC-ACCEL 42 | // helloworld_job_t is user defined in hls_helloworld/include/action_change_case.h 43 | typedef struct { 44 | CONTROL Control; /* 16 bytes */ 45 | image_filtering_job_t Data; /* up to 108 bytes */ 46 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(image_filtering_job_t)]; 47 | } action_reg; 48 | 49 | #endif /* __ACTION_PIXEL_FILTER_H__*/ 50 | -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../ActionTypes.md)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | snap_image_filter: params.o bmp.o 40 | #snap_image_filter_objs = action_pixel_filtering.o params.o bmp.o 41 | snap_image_filter_objs = params.o bmp.o 42 | 43 | projs += snap_image_filter 44 | 45 | # If you have the host code outside of the default snap directory structure, 46 | # change to /path/to/snap/actions/software.mk 47 | include $(SNAP_ROOT)/actions/software.mk 48 | -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/apples.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hls_image_filter/sw/apples.bmp -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/params.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef _PARAM_H_ // prevent recursive inclusion 18 | #define _PARAM_H_ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | typedef struct { 37 | uint16_t card_no; 38 | char *input; 39 | char *output; 40 | uint8_t addr_in; 41 | uint8_t addr_out; 42 | uint8_t type_in; 43 | uint8_t type_out; 44 | unsigned long timeout; 45 | int verify; 46 | snap_action_flag_t action_irq; 47 | int verbose_flag; 48 | } 49 | STRparam; 50 | 51 | void usage(const char *prog); 52 | STRparam* readParams(int argc, char *argv[]); 53 | 54 | static STRparam parms; 55 | 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/tiger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hls_image_filter/sw/tiger.bmp -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/tiger_reference.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hls_image_filter/sw/tiger_reference.bmp -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/tiger_small.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hls_image_filter/sw/tiger_small.bmp -------------------------------------------------------------------------------- /actions/hls_image_filter/sw/tiger_small_reference.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/actions/hls_image_filter/sw/tiger_small_reference.bmp -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/README.md: -------------------------------------------------------------------------------- 1 | # HLS_MEMCOPY_1024 EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL 4 | * C code allows copying to/from : 5 | * HOST memory (for example a file) 6 | * DDR SDRAM memory on the FPGA board 7 | * Block RAM memory (memory inside the FPGA itself) 8 | * The example code details the copy mechanism. 9 | 10 | :star: Please check the [https://opencapi.github.io/oc-accel-doc/actions-doc/hls_memcopy_1024](https://opencapi.github.io/oc-accel-doc/actions-doc/hls_memcopy_1024/) directory for detailed information 11 | 12 | -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= memcopy 41 | SOLUTION_DIR ?= hlsMemcopy 42 | srcs += hw_action_memcopy_1024.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/hw/hw_action_memcopy_1024.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_HLS_MEMCOPY_H__ 2 | #define __ACTION_HLS_MEMCOPY_H__ 3 | 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* Memcopy Job definition */ 26 | 27 | 28 | #define MAX_NB_OF_BYTES_READ (256 * 1024) 29 | #define LCL_MEM_MAX_SIZE (256 * 1024 * 1024) // HBM is 256MB 30 | #define MAX_NB_OF_WORDS_READ_512 (MAX_NB_OF_BYTES_READ/BPERDW_512) 31 | #define MAX_NB_OF_WORDS_READ_1024 (MAX_NB_OF_BYTES_READ/BPERDW_1024) 32 | 33 | //--------------------------------------------------------------------- 34 | typedef struct { 35 | CONTROL Control; /* 16 bytes */ 36 | memcopy_job_t Data; /* up to 108 bytes */ 37 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(memcopy_job_t)]; 38 | } action_reg; 39 | 40 | #endif /* __ACTION_HLS_MEMCOPY_H__ */ 41 | -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | 41 | #snap_memcopy_objs = sw_action_memcopy.o 42 | snap_memcopy: ${snap_memcopy_objs} 43 | snap_memcopy_libs = -lm 44 | 45 | projs += snap_memcopy 46 | 47 | # If you have the host code outside of the default snap directory structure, 48 | # change to /path/to/snap/actions/software.mk 49 | include $(SNAP_ROOT)/actions/software.mk 50 | -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/tests/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f *.log *.bin *.out 3 | -------------------------------------------------------------------------------- /actions/hls_memcopy_1024/tests/process.awk: -------------------------------------------------------------------------------- 1 | #! /usr/bin/awk -f 2 | 3 | #Process following string 4 | #memcopy of 512 bytes took 18 usec @ 28.444 MiB/sec (from HOST_DRAM to FPGA_BRAM) 5 | 6 | BEGIN { 7 | FS=" " 8 | } 9 | { 10 | # print $0 11 | if ($0 ~ "HOST_DRAM to FPGA_BRAM") { 12 | a1_iter++ 13 | a1_size[a1_iter]=$3 14 | a1_usec[a1_iter]=$6 15 | a1_bw[a1_iter]=$9 16 | } 17 | if ($0 ~ "FPGA_BRAM to HOST_DRAM") { 18 | a2_iter++ 19 | a2_size[a2_iter]=$3 20 | a2_usec[a2_iter]=$6 21 | a2_bw[a2_iter]=$9 22 | } 23 | if ($0 ~ "HBM or DDR Port 0 to FPGA_BRAM") { 24 | a3_iter++ 25 | a3_size[a3_iter]=$3 26 | a3_usec[a3_iter]=$6 27 | a3_bw[a3_iter]=$9 28 | } 29 | if ($0 ~ "FPGA_BRAM to HBM or DDR Port 0") { 30 | a4_iter++ 31 | a4_size[a4_iter]=$3 32 | a4_usec[a4_iter]=$6 33 | a4_bw[a4_iter]=$9 34 | } 35 | } 36 | END { 37 | i=1 38 | printf "+-------------------------------------------------------------------------------+\n" 39 | printf "| OC-Accel hls_memcopy_1024 Throughput (MBytes/s) |\n" 40 | printf "+-------------------------------------------------------------------------------+\n" 41 | printf "+------------LCL stands for DDR or HBM memory according to hardware-------------+\n" 42 | printf "%12s %16s %16s %16s %16s\n","bytes", "Host->FPGA_RAM", "FPGA_RAM->Host","FPGA(LCL->BRAM)", "FPGA(BRAM->LCL)" 43 | printf " -------------------------------------------------------------------------------\n" 44 | while (i <= a1_iter) { 45 | printf "%12s %16s %16s %16s %16s\n",a1_size[i], a1_bw[i], a2_bw[i], a3_bw[i], a4_bw[i] 46 | i++ 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/README.md: -------------------------------------------------------------------------------- 1 | # HLS_MEMCOPY_512 EXAMPLE 2 | 3 | * Provides a simple base allowing to discover OC-ACCEL 4 | * C code allows copying to/from : 5 | * HOST memory (for example a file) 6 | * DDR SDRAM memory on the FPGA board 7 | * Block RAM memory (memory inside the FPGA itself) 8 | * The example code details the copy mechanism. 9 | 10 | :star: Please check the [https://opencapi.github.io/oc-accel-doc/actions-doc/hls_memcopy_512/](https://opencapi.github.io/oc-accel-doc/actions-doc/hls_memcopy_512/) directory for detailed information 11 | 12 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | SOLUTION_NAME ?= memcopy 41 | SOLUTION_DIR ?= hlsMemcopy 42 | srcs += hw_action_memcopy_512.cpp 43 | 44 | # If you have the action code outside of the default snap directory structure, 45 | # change to /path/to/snap/actions/hls.mk 46 | include $(SNAP_ROOT)/actions/hls.mk 47 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/hw/hw_action_memcopy_512.H: -------------------------------------------------------------------------------- 1 | #ifndef __ACTION_HLS_MEMCOPY_H__ 2 | #define __ACTION_HLS_MEMCOPY_H__ 3 | 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "hls_snap_1024.H" 25 | #include /* Memcopy Job definition */ 26 | 27 | 28 | #define MAX_NB_OF_BYTES_READ (256 * 1024) 29 | #define LCL_MEM_MAX_SIZE (256 * 1024 * 1024) // HBM is 256MB 30 | #define MAX_NB_OF_WORDS_READ_512 (MAX_NB_OF_BYTES_READ/BPERDW_512) 31 | #define MAX_NB_OF_WORDS_READ_1024 (MAX_NB_OF_BYTES_READ/BPERDW_1024) 32 | 33 | //--------------------------------------------------------------------- 34 | typedef struct { 35 | CONTROL Control; /* 16 bytes */ 36 | memcopy_job_t Data; /* up to 108 bytes */ 37 | uint8_t padding[SNAP_HLS_JOBSIZE - sizeof(memcopy_job_t)]; 38 | } action_reg; 39 | 40 | #endif /* __ACTION_HLS_MEMCOPY_H__ */ 41 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2017 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | ifneq ("$(wildcard ../../../actions)","") 32 | SNAP_ROOT=$(abspath ../../../) 33 | else 34 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 35 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 36 | endif 37 | endif 38 | 39 | # This is solution specific. Check if we can replace this by generics too. 40 | 41 | #snap_memcopy_objs = sw_action_memcopy.o 42 | snap_memcopy: ${snap_memcopy_objs} 43 | snap_memcopy_libs = -lm 44 | 45 | projs += snap_memcopy 46 | 47 | # If you have the host code outside of the default snap directory structure, 48 | # change to /path/to/snap/actions/software.mk 49 | include $(SNAP_ROOT)/actions/software.mk 50 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/tests/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm -f *.log *.bin *.out 3 | -------------------------------------------------------------------------------- /actions/hls_memcopy_512/tests/process.awk: -------------------------------------------------------------------------------- 1 | #! /usr/bin/awk -f 2 | 3 | #Process following string 4 | #memcopy of 512 bytes took 18 usec @ 28.444 MiB/sec (from HOST_DRAM to FPGA_BRAM) 5 | 6 | BEGIN { 7 | FS=" " 8 | } 9 | { 10 | # print $0 11 | if ($0 ~ "HOST_DRAM to FPGA_BRAM") { 12 | a1_iter++ 13 | a1_size[a1_iter]=$3 14 | a1_usec[a1_iter]=$6 15 | a1_bw[a1_iter]=$9 16 | } 17 | if ($0 ~ "FPGA_BRAM to HOST_DRAM") { 18 | a2_iter++ 19 | a2_size[a2_iter]=$3 20 | a2_usec[a2_iter]=$6 21 | a2_bw[a2_iter]=$9 22 | } 23 | if ($0 ~ "HBM or DDR Port 0 to FPGA_BRAM") { 24 | a3_iter++ 25 | a3_size[a3_iter]=$3 26 | a3_usec[a3_iter]=$6 27 | a3_bw[a3_iter]=$9 28 | } 29 | if ($0 ~ "FPGA_BRAM to HBM or DDR Port 0") { 30 | a4_iter++ 31 | a4_size[a4_iter]=$3 32 | a4_usec[a4_iter]=$6 33 | a4_bw[a4_iter]=$9 34 | } 35 | } 36 | END { 37 | i=1 38 | printf "+-------------------------------------------------------------------------------+\n" 39 | printf "| OC-Accel hls_memcopy_512 Throughput (MBytes/s) |\n" 40 | printf "+-------------------------------------------------------------------------------+\n" 41 | printf "+------------LCL stands for DDR or HBM memory according to hardware-------------+\n" 42 | printf "%12s %16s %16s %16s %16s\n","bytes", "Host->FPGA_RAM", "FPGA_RAM->Host","FPGA(LCL->BRAM)", "FPGA(BRAM->LCL)" 43 | printf " -------------------------------------------------------------------------------\n" 44 | while (i <= a1_iter) { 45 | printf "%12s %16s %16s %16s %16s\n",a1_size[i], a1_bw[i], a2_bw[i], a3_bw[i], a4_bw[i] 46 | i++ 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /actions/hls_udp_512/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | subdirs += sw hw 18 | 19 | all: $(subdirs) 20 | 21 | # Only build if the subdirectory is existent and if Makefile is there 22 | .PHONY: $(subdirs) 23 | $(subdirs): 24 | @if [ -d $@ -a -f $@/Makefile ]; then \ 25 | $(MAKE) -C $@ || exit 1; \ 26 | else \ 27 | echo "INFO: No Makefile available in $@ ..."; \ 28 | fi 29 | 30 | # Cleanup for all subdirectories. 31 | # Only dive into subdirectory if existent and if Makefile is there. 32 | clean: 33 | @for dir in $(subdirs); do \ 34 | if [ -d $$dir -a -f $$dir/Makefile ]; then \ 35 | $(MAKE) -C $$dir $@ || exit 1; \ 36 | fi \ 37 | done 38 | @find . -depth -name '*~' -exec rm -rf '{}' \; -print 39 | @find . -depth -name '.#*' -exec rm -rf '{}' \; -print 40 | -------------------------------------------------------------------------------- /actions/hls_udp_512/README.md: -------------------------------------------------------------------------------- 1 | # HLS_UDP EXAMPLE 2 | :star: * Detailed documentation is available at : 3 | -------------------------------------------------------------------------------- /actions/hls_udp_512/hw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in hw folder of an action (three directories below snap root) 31 | #S2OC ifneq ("$(wildcard ../../../ActionTypes.md)","") 32 | ifneq ("$(wildcard ../../../actions)","") 33 | SNAP_ROOT=$(abspath ../../../) 34 | else 35 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 36 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 37 | endif 38 | endif 39 | 40 | # This is solution specific. Check if we can replace this by generics too. 41 | SOLUTION_NAME ?= hls_udp 42 | SOLUTION_DIR ?= hls_UDP 43 | srcs += eth_decode.cpp hls_udp.cpp write_data.cpp 44 | 45 | # If you have the action code outside of the default snap directory structure, 46 | # change to /path/to/snap/actions/hls.mk 47 | include $(SNAP_ROOT)/actions/hls.mk 48 | -------------------------------------------------------------------------------- /actions/hls_udp_512/hw/README.md: -------------------------------------------------------------------------------- 1 | :star: * Detailed documentation is available at : 2 | -------------------------------------------------------------------------------- /actions/hls_udp_512/hw/action_test.h: -------------------------------------------------------------------------------- 1 | #include 2 | //#include 3 | //#include "hls_udp.h" 4 | 5 | 6 | #pragma pack(push) 7 | #pragma pack(2) 8 | struct RAW_JFUDP_Packet 9 | { 10 | char dest_mac[6]; 11 | char sour_mac[6]; 12 | uint16_t ether_type; 13 | uint16_t ipv4_header_h; 14 | uint16_t ipv4_header_total_length; 15 | uint16_t ipv4_header_identification; 16 | uint16_t ipv4_header_flags_frag; 17 | uint16_t ipv4_header_ttl_protocol; 18 | uint16_t ipv4_header_checksum; 19 | uint32_t ipv4_header_sour_ip; 20 | uint32_t ipv4_header_dest_ip; 21 | uint16_t udp_sour_port; 22 | uint16_t udp_dest_port; 23 | uint16_t udp_length; 24 | uint16_t udp_checksum; 25 | // 42 bytes 26 | uint64_t framenum; 27 | uint32_t exptime; // x 1e-7 sec 28 | uint32_t packetnum; 29 | uint64_t bunchid; 30 | uint64_t timestamp; 31 | uint16_t moduleID; 32 | uint16_t xCoord; 33 | uint16_t yCoord; 34 | uint16_t zCoord; 35 | uint32_t debug; 36 | uint16_t roundRobin; 37 | uint8_t detectortype; 38 | uint8_t headerVersion; 39 | // 48 + 42 = 90 bytes 40 | uint16_t data[4096]; 41 | // 96 + 8192 = 8282 bytes 42 | }; 43 | #pragma pack(pop) 44 | 45 | -------------------------------------------------------------------------------- /actions/hls_udp_512/sw/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # 18 | # Generate HDL version of the HLS sources 19 | # 20 | # The generated HDL depends on the chip which is used and 21 | # therefore must match what is being used to build the 22 | # toplevel SNAP bitstream. 23 | # 24 | # FIXME Pass part_number and other parameters from toplevel 25 | # build-system as required. 26 | # 27 | 28 | # Finding $SNAP_ROOT 29 | ifndef SNAP_ROOT 30 | # check if we are in sw folder of an action (three directories below snap root) 31 | #S2OC ifneq ("$(wildcard ../../../ActionTypes.md)","") 32 | ifneq ("$(wildcard ../../../actions)","") 33 | SNAP_ROOT=$(abspath ../../../) 34 | else 35 | $(info You are not building your software from the default directory (/path/to/snap/actions//sw) or specified a wrong $$SNAP_ROOT.) 36 | $(error Please make sure that $$SNAP_ROOT is set up correctly.) 37 | endif 38 | endif 39 | 40 | #CXX=g++ 41 | # This is solution specific. Check if we can replace this by generics too. 42 | 43 | #SRCS=oc-accel_udp.o 44 | 45 | #oc-accel_udp: $(SRCS) 46 | # $(CXX) $(SRCS) -o oc-accel_udp $(JF_LDLIBS) ${LDFLAGS} 47 | 48 | #oc-accel_udp.o: oc-accel_udp.c 49 | 50 | #clean: 51 | # rm -f *.o oc-accel_udp 52 | 53 | #oc-accel_udp_objs = sw_action_udp.o 54 | oc-accel_udp: ${oc-accel_udp_objs} 55 | 56 | projs += oc-accel_udp 57 | 58 | 59 | # If you have the host code outside of the default snap directory structure, 60 | # change to /path/to/snap/actions/software.mk 61 | include $(SNAP_ROOT)/actions/software.mk 62 | -------------------------------------------------------------------------------- /check_platform.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Copyright 2019 International Business Machines 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## 17 | 18 | if [[ -z ${SNAP_ROOT} ]]; then 19 | echo "err: SNAP_ROOT not set!" 20 | exit 1 21 | fi 22 | 23 | SNAP_MAINT="${SNAP_ROOT}/software/tools/snap_maint" 24 | 25 | # echo -n "Checking ${SNAP_MAINT} ... " 26 | if [ ! -x ${SNAP_MAINT} ]; then 27 | # echo "Not build yet!" 28 | exit 0 29 | fi 30 | # echo "OK" 31 | 32 | # Software seems to be build, check if it is properly executable 33 | # echo -n "Trying out ${SNAP_MAINT} ... " 34 | error=0 35 | ${SNAP_MAINT} -h &> /dev/null || error=1 36 | if [ $error -eq 1 ]; then 37 | # echo "Not executable!" 38 | exit 1 39 | fi 40 | # echo "OK" 41 | 42 | exit 0 43 | -------------------------------------------------------------------------------- /debug_timing: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | FILE="./hardware/build/Reports/timing_summary.rpt" 3 | if [ -f $FILE ]; then \ 4 | TEXT="Timing constraints are not met" 5 | MAX_VIOLATION=`grep -B3 "$TEXT" "$FILE" | awk '{print $1}' | head -n 1` 6 | LINE=`grep -A1 -n VIOL "$FILE"|grep -m1 -e "$MAX_VIOLATION" | cut -d ':' -f 1` 7 | echo "-------------------------------------------------------------------" 8 | echo "-------------- DISPLAY the 10 worst timing violations -------------" 9 | echo "-------------------------------------------------------------------" 10 | #grep -A1 -m10 VIOL hardware/build/Reports/timing_summary.rpt 11 | tail -n +"$LINE" "$FILE" | grep -A1 -m10 VIOL 12 | echo "-------------------------------------------------------------------" 13 | echo "- => Few options to solve these timing violations <= -" 14 | echo "- => Identify and then correct the Source of the violation <= -" 15 | echo "- bsp signals are related to PSL/BSP/TLx/DLx logic -" 16 | echo "- There is not a lot you can do in the logic, but .... -" 17 | echo "- Not a FPGA expert? => it's worth retrying a make image -" 18 | echo "- FPGA expert? => change placement constraints of the PSL/BSP -" 19 | echo "- oc_func/../hls_action signals are related to OC-Accel or Action logic" 20 | echo "- There should be a way to solve that in the logic -" 21 | echo "- You can first retry a make image (a new placement may work) -" 22 | echo "- Try changing the way you have coded the logic of your action -" 23 | echo "- or use Kconfig menu to try and decrease the HLS clock period -" 24 | echo "- The path listed above should show you the function to change -" 25 | echo "-------------------------------------------------------------------" 26 | else 27 | echo "This script needs a timing report generated with a make image"; 28 | fi 29 | -------------------------------------------------------------------------------- /defconfig/OC-AD9H3.hls_memcopy_1024.defconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated file; DO NOT EDIT. 3 | # Kernel Configuration 4 | # 5 | # AD9V3 is not set 6 | AD9H3=y 7 | # AD9H7 is not set 8 | FPGACARD="AD9H3" 9 | FLASH_INTERFACE="SPIx8" 10 | FLASH_SIZE="64" 11 | FLASH_FACTORYADDR="0x00000000" 12 | FLASH_USERADDR="0x08000000" 13 | OPENCAPI30=y 14 | CAPI_VER="opencapi30" 15 | FPGACHIP="xcvu33p-fsvh2104-2-e" 16 | NUM_OF_ACTIONS=1 17 | # HLS_ACTION is not set 18 | # HDL_ACTION is not set 19 | # HDL_EXAMPLE is not set 20 | # HDL_SINGLE_ENGINE is not set 21 | # HDL_MULTI_PROCESS is not set 22 | # HDL_UNIT_SIM is not set 23 | # HLS_HELLOWORLD is not set 24 | HLS_MEMCOPY_1024=y 25 | HALF_WIDTH="FALSE" 26 | ENABLE_HLS_SUPPORT=y 27 | HLS_SUPPORT="TRUE" 28 | # DISABLE_SDRAM_AND_BRAM is not set 29 | FORCE_SDRAM_OR_BRAM=y 30 | SDRAM_USED="FALSE" 31 | FORCE_HBM=y 32 | ENABLE_HBM=y 33 | HBM_USED="TRUE" 34 | # ENABLE_BRAM is not set 35 | BRAM_USED="FALSE" 36 | DDR3_USED="FALSE" 37 | DDR4_USED="FALSE" 38 | DDRI_USED="FALSE" 39 | DISABLE_NVME=y 40 | # FORCE_NVME is not set 41 | NVME_USED="FALSE" 42 | USER_CLOCK="FALSE" 43 | # ACTION_USER_CLOCK is not set 44 | SIM_XSIM=y 45 | # SIM_IRUN is not set 46 | # SIM_XCELIUM is not set 47 | # SIM_MODELSIM is not set 48 | # SIM_QUESTA is not set 49 | # NO_SIM is not set 50 | SIMULATOR="xsim" 51 | DENALI_USED="FALSE" 52 | OCSE_PATH="../ocse" 53 | 54 | # 55 | # ================= Advanced Options: ================= 56 | # 57 | SPEED_25G=y 58 | # SPEED_20G is not set 59 | PHY_SPEED="25.78125" 60 | AXI_ID_WIDTH=3 61 | # Action_clock_50MHz is not set 62 | # Action_clock_100MHz is not set 63 | # Action_clock_150MHz is not set 64 | Action_clock_200MHz=y 65 | # Action_clock_250MHz is not set 66 | # Action_clock_300MHz is not set 67 | # Action_clock_350MHz is not set 68 | # Action_clock_400MHz is not set 69 | USER_CLOCK_FREQ=200 70 | HLS_CLOCK_PERIOD_CONSTRAINT="4ns" 71 | # ENABLE_ILA is not set 72 | ILA_DEBUG="FALSE" 73 | CLOUD_USER_FLOW="FALSE" 74 | CLOUD_BUILD_BITFILE="FALSE" 75 | UNIT_SIM_USED="FALSE" 76 | # ENABLE_ODMA is not set 77 | ODMA_USED="FALSE" 78 | ENABLE_FLASH=y 79 | FLASH_USED="TRUE" 80 | -------------------------------------------------------------------------------- /defconfig/OC-AD9H7.hls_memcopy_1024.defconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated file; DO NOT EDIT. 3 | # Kernel Configuration 4 | # 5 | # AD9V3 is not set 6 | # AD9H3 is not set 7 | AD9H7=y 8 | FPGACARD="AD9H7" 9 | FLASH_INTERFACE="SPIx8" 10 | FLASH_SIZE="128" 11 | FLASH_FACTORYADDR="0x00000000" 12 | FLASH_USERADDR="0x08000000" 13 | OPENCAPI30=y 14 | CAPI_VER="opencapi30" 15 | FPGACHIP="xcvu37p-fsvh2892-2-e" 16 | NUM_OF_ACTIONS=1 17 | # HLS_ACTION is not set 18 | # HDL_ACTION is not set 19 | # HDL_EXAMPLE is not set 20 | # HDL_SINGLE_ENGINE is not set 21 | # HDL_MULTI_PROCESS is not set 22 | # HDL_UNIT_SIM is not set 23 | # HLS_HELLOWORLD is not set 24 | HLS_MEMCOPY_1024=y 25 | HALF_WIDTH="FALSE" 26 | ENABLE_HLS_SUPPORT=y 27 | HLS_SUPPORT="TRUE" 28 | # DISABLE_SDRAM_AND_BRAM is not set 29 | FORCE_SDRAM_OR_BRAM=y 30 | SDRAM_USED="FALSE" 31 | FORCE_HBM=y 32 | ENABLE_HBM=y 33 | HBM_USED="TRUE" 34 | # ENABLE_BRAM is not set 35 | BRAM_USED="FALSE" 36 | DDR3_USED="FALSE" 37 | DDR4_USED="FALSE" 38 | DDRI_USED="FALSE" 39 | DISABLE_NVME=y 40 | # FORCE_NVME is not set 41 | NVME_USED="FALSE" 42 | USER_CLOCK="FALSE" 43 | # ACTION_USER_CLOCK is not set 44 | SIM_XSIM=y 45 | # SIM_IRUN is not set 46 | # SIM_XCELIUM is not set 47 | # SIM_MODELSIM is not set 48 | # SIM_QUESTA is not set 49 | # NO_SIM is not set 50 | SIMULATOR="xsim" 51 | DENALI_USED="FALSE" 52 | OCSE_PATH="../ocse" 53 | 54 | # 55 | # ================= Advanced Options: ================= 56 | # 57 | SPEED_25G=y 58 | # SPEED_20G is not set 59 | PHY_SPEED="25.78125" 60 | AXI_ID_WIDTH=3 61 | # Action_clock_50MHz is not set 62 | # Action_clock_100MHz is not set 63 | # Action_clock_150MHz is not set 64 | Action_clock_200MHz=y 65 | # Action_clock_250MHz is not set 66 | # Action_clock_300MHz is not set 67 | # Action_clock_350MHz is not set 68 | # Action_clock_400MHz is not set 69 | USER_CLOCK_FREQ=200 70 | HLS_CLOCK_PERIOD_CONSTRAINT="4ns" 71 | # ENABLE_ILA is not set 72 | ILA_DEBUG="FALSE" 73 | CLOUD_USER_FLOW="FALSE" 74 | CLOUD_BUILD_BITFILE="FALSE" 75 | UNIT_SIM_USED="FALSE" 76 | # ENABLE_ODMA is not set 77 | ODMA_USED="FALSE" 78 | ENABLE_FLASH=y 79 | FLASH_USED="TRUE" 80 | -------------------------------------------------------------------------------- /defconfig/README.md: -------------------------------------------------------------------------------- 1 | From the oc-accel directory, you can use 2 ways to configure and use the OC-ACCEL framework. 2 | 3 | Option 1 (default): use the Kconfig menu by typing: **make snap_config** 4 | This will allow you to define a specific configuration which will be saved in the *.snap_config* file 5 | All commands **make model/sim/image** will use this *.snap_config* file 6 | 7 | Option 2: do not use the Kconfig menu but use a specific saved configuration file (automated test -jenkins) 8 | Build a *.snap_config* file using the Kconfig menu (see option 1) 9 | Then move and rename the *.snap_config* file to *CARD.action.defconfig* into the *oc-accel/defconfig* directory. 10 | Following command can then be executed (from oc-accel installation directory): 11 | **make CARD.action.defconfig** to set the *.snap_config* with the *CARD.action.defconfig* configuration 12 | All commands **make model/sim/image** will then use this *.snap_config file* 13 | 14 | -------------------------------------------------------------------------------- /defconfig/hdl_unit_sim.odma_mm_512.defconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated file; DO NOT EDIT. 3 | # Kernel Configuration 4 | # 5 | AD9V3=y 6 | # AD9H3 is not set 7 | # AD9H7 is not set 8 | FPGACARD="AD9V3" 9 | FLASH_INTERFACE="SPIx8" 10 | FLASH_SIZE="64" 11 | FLASH_FACTORYADDR="0x00000000" 12 | FLASH_USERADDR="0x08000000" 13 | OPENCAPI30=y 14 | CAPI_VER="opencapi30" 15 | FPGACHIP="xcvu3p-ffvc1517-2-e" 16 | NUM_OF_ACTIONS=1 17 | # HLS_ACTION is not set 18 | # HDL_ACTION is not set 19 | # HDL_EXAMPLE is not set 20 | # HDL_SINGLE_ENGINE is not set 21 | # HDL_MULTI_PROCESS is not set 22 | HDL_UNIT_SIM=y 23 | # HLS_HELLOWORLD is not set 24 | # HLS_MEMCOPY_1024 is not set 25 | HALF_WIDTH="FALSE" 26 | # ENABLE_HLS_SUPPORT is not set 27 | HLS_SUPPORT="FALSE" 28 | DISABLE_SDRAM_AND_BRAM=y 29 | # FORCE_SDRAM_OR_BRAM is not set 30 | SDRAM_USED="FALSE" 31 | HBM_USED="FALSE" 32 | BRAM_USED="FALSE" 33 | DDR3_USED="FALSE" 34 | DDR4_USED="FALSE" 35 | DDRI_USED="FALSE" 36 | DISABLE_NVME=y 37 | # FORCE_NVME is not set 38 | NVME_USED="FALSE" 39 | USER_CLOCK="FALSE" 40 | # ACTION_USER_CLOCK is not set 41 | # SIM_XSIM is not set 42 | # SIM_IRUN is not set 43 | SIM_XCELIUM=y 44 | # SIM_MODELSIM is not set 45 | # SIM_QUESTA is not set 46 | # NO_SIM is not set 47 | SIMULATOR="xcelium" 48 | DENALI_USED="FALSE" 49 | OCSE_PATH="../ocse" 50 | 51 | # 52 | # ================= Advanced Options: ================= 53 | # 54 | SPEED_25G=y 55 | # SPEED_20G is not set 56 | PHY_SPEED="25.78125" 57 | AXI_ID_WIDTH=5 58 | # Action_clock_50MHz is not set 59 | # Action_clock_100MHz is not set 60 | # Action_clock_150MHz is not set 61 | Action_clock_200MHz=y 62 | # Action_clock_250MHz is not set 63 | # Action_clock_300MHz is not set 64 | # Action_clock_350MHz is not set 65 | # Action_clock_400MHz is not set 66 | USER_CLOCK_FREQ=200 67 | HLS_CLOCK_PERIOD_CONSTRAINT="4ns" 68 | # ENABLE_ILA is not set 69 | ILA_DEBUG="FALSE" 70 | CLOUD_USER_FLOW="FALSE" 71 | CLOUD_BUILD_BITFILE="FALSE" 72 | ENABLE_UNIT_VERIF=y 73 | UNIT_SIM_USED="TRUE" 74 | ENABLE_ODMA=y 75 | ODMA_USED="TRUE" 76 | # ENABLE_ODMA_ST_MODE is not set 77 | ODMA_ST_MODE_USED="FALSE" 78 | ENABLE_ODMA_512=y 79 | ODMA_512_USED="TRUE" 80 | ENABLE_FLASH=y 81 | FLASH_USED="TRUE" 82 | -------------------------------------------------------------------------------- /defconfig/hdl_unit_sim.odma_st_512.defconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Automatically generated file; DO NOT EDIT. 3 | # Kernel Configuration 4 | # 5 | AD9V3=y 6 | # AD9H3 is not set 7 | # AD9H7 is not set 8 | FPGACARD="AD9V3" 9 | FLASH_INTERFACE="SPIx8" 10 | FLASH_SIZE="64" 11 | FLASH_FACTORYADDR="0x00000000" 12 | FLASH_USERADDR="0x08000000" 13 | OPENCAPI30=y 14 | CAPI_VER="opencapi30" 15 | FPGACHIP="xcvu3p-ffvc1517-2-e" 16 | NUM_OF_ACTIONS=1 17 | # HLS_ACTION is not set 18 | # HDL_ACTION is not set 19 | # HDL_EXAMPLE is not set 20 | # HDL_SINGLE_ENGINE is not set 21 | # HDL_MULTI_PROCESS is not set 22 | HDL_UNIT_SIM=y 23 | # HLS_HELLOWORLD is not set 24 | # HLS_MEMCOPY_1024 is not set 25 | HALF_WIDTH="FALSE" 26 | # ENABLE_HLS_SUPPORT is not set 27 | HLS_SUPPORT="FALSE" 28 | DISABLE_SDRAM_AND_BRAM=y 29 | # FORCE_SDRAM_OR_BRAM is not set 30 | SDRAM_USED="FALSE" 31 | HBM_USED="FALSE" 32 | BRAM_USED="FALSE" 33 | DDR3_USED="FALSE" 34 | DDR4_USED="FALSE" 35 | DDRI_USED="FALSE" 36 | DISABLE_NVME=y 37 | # FORCE_NVME is not set 38 | NVME_USED="FALSE" 39 | USER_CLOCK="FALSE" 40 | # ACTION_USER_CLOCK is not set 41 | # SIM_XSIM is not set 42 | # SIM_IRUN is not set 43 | SIM_XCELIUM=y 44 | # SIM_MODELSIM is not set 45 | # SIM_QUESTA is not set 46 | # NO_SIM is not set 47 | SIMULATOR="xcelium" 48 | DENALI_USED="FALSE" 49 | OCSE_PATH="../ocse" 50 | 51 | # 52 | # ================= Advanced Options: ================= 53 | # 54 | SPEED_25G=y 55 | # SPEED_20G is not set 56 | PHY_SPEED="25.78125" 57 | AXI_ID_WIDTH=5 58 | # Action_clock_50MHz is not set 59 | # Action_clock_100MHz is not set 60 | # Action_clock_150MHz is not set 61 | Action_clock_200MHz=y 62 | # Action_clock_250MHz is not set 63 | # Action_clock_300MHz is not set 64 | # Action_clock_350MHz is not set 65 | # Action_clock_400MHz is not set 66 | USER_CLOCK_FREQ=200 67 | HLS_CLOCK_PERIOD_CONSTRAINT="4ns" 68 | # ENABLE_ILA is not set 69 | ILA_DEBUG="FALSE" 70 | CLOUD_USER_FLOW="FALSE" 71 | CLOUD_BUILD_BITFILE="FALSE" 72 | ENABLE_UNIT_VERIF=y 73 | UNIT_SIM_USED="TRUE" 74 | ENABLE_ODMA=y 75 | ODMA_USED="TRUE" 76 | ENABLE_ODMA_ST_MODE=y 77 | ODMA_ST_MODE_USED="TRUE" 78 | ENABLE_ODMA_512=y 79 | ODMA_512_USED="TRUE" 80 | ENABLE_FLASH=y 81 | FLASH_USED="TRUE" 82 | -------------------------------------------------------------------------------- /hardware/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | hdl/hls/action_wrapper.vhd 3 | hdl/nvme/component.xml 4 | hdl/nvme/xgui 5 | build/ 6 | logs/* 7 | viv_project*/ 8 | ip/ 9 | sim/*.log 10 | sim/20* 11 | .bitstream_name.txt 12 | .create_ip_done 13 | .hw_project_done 14 | 15 | -------------------------------------------------------------------------------- /hardware/README.md: -------------------------------------------------------------------------------- 1 | # OC-Accel hardware 2 | 3 | This subdirectory contains OC-Accel hardware infrustructure that provides TLX-AXI bridge for user's action, as well as board-specific files and scripts for simulation, image building, project creation and IP generation. 4 | 5 | Check for more information. 6 | -------------------------------------------------------------------------------- /hardware/hdl/core/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | psl_fpga.vhd 3 | psl_fpga.vhd_source 4 | psl_accel.vhd 5 | psl_accel.vhd_source 6 | dma.vhd 7 | dma_types.vhd 8 | dma_buffer.vhd 9 | mmio.vhd 10 | oc_function.vhd 11 | snap_core.vhd 12 | snap_core_types.vhd 13 | snap_interface_types.vhd 14 | -------------------------------------------------------------------------------- /hardware/hdl/oc/ram_simple_dual.v: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `timescale 1ns/1ps 17 | 18 | module ram_simple_dual #(parameter DATA_WIDTH = 8, parameter ADDR_WIDTH = 5, parameter DISTR = 0) (clk,ena,enb,wea,addra,addrb,dia,dob); 19 | 20 | parameter DEPTH = 2**ADDR_WIDTH; 21 | 22 | input clk,ena,enb,wea; 23 | input [ADDR_WIDTH-1:0] addra,addrb; 24 | input [DATA_WIDTH-1:0] dia; 25 | output [DATA_WIDTH-1:0] dob; 26 | reg [DATA_WIDTH-1:0] ram [DEPTH-1:0]; 27 | reg [DATA_WIDTH-1:0] dob; 28 | 29 | 30 | generate 31 | if (DISTR) begin : distributed_ram 32 | (* ram_style = "distributed" *)reg [DATA_WIDTH-1:0] ram [DEPTH-1:0]; 33 | integer i; 34 | initial for (i=0; i /dev/null ; then exec vivado_lab -nolog -nojournal -mode batch -source "$0" -tclargs "$@"; else exec vivado -nolog -nojournal -mode batch -source "$0" -tclargs "$@"; fi 22 | 23 | set flash_interface $::env(FLASH_INTERFACE) 24 | set flash_size $::env(FLASH_SIZE) 25 | set user_addr $::env(FLASH_USERADDR) 26 | set factory_addr $::env(FLASH_FACTORYADDR) 27 | 28 | 29 | if { $argc != 3 } { 30 | puts "Build an .mcs file for flashing a card from scratch" 31 | puts "Usage:" 32 | puts " vivado -nolog -nojournal -mode batch -source build_mcs.tcl -tclargs factory.bit user.bit mcsoutput.mcs" 33 | puts "Note: vivado_lab can be used instead of vivado" 34 | exit 90 35 | } 36 | 37 | set factory_bit [lindex $argv 0] 38 | set user_bit [lindex $argv 1] 39 | set mcsfile [lindex $argv 2] 40 | write_cfgmem -format mcs -size $flash_size -interface $flash_interface -loadbit "up $factory_addr $factory_bit up $user_addr $user_bit" $mcsfile -force 41 | -------------------------------------------------------------------------------- /hardware/setup/cov.ccf: -------------------------------------------------------------------------------- 1 | select_functional 2 | set_covergroup -default_goal 100 3 | set_covergroup -per_instance_default_one 4 | set_libcell_scoring 5 | -------------------------------------------------------------------------------- /hardware/setup/export_irun.tcl: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016-2018, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | 19 | set vivadoVer [version -short] 20 | set root_dir $::env(SNAP_HARDWARE_ROOT) 21 | set ies_libs $::env(IES_LIBS) 22 | set log_dir $::env(LOGS_DIR) 23 | set log_file $log_dir/compile_$::env(SIMULATOR).log 24 | set nvme_used $::env(NVME_USED) 25 | 26 | puts " export simulation for version=$vivadoVer" 27 | 28 | if { ($nvme_used == "TRUE") && ($vivadoVer >= "2017.4") } { 29 | puts " ### INFO ### For NVME simulation you have to patch your Vivado" 30 | puts " installation. Please follow the instructions in Xilinx AR# 70597." 31 | } 32 | 33 | open_project $root_dir/viv_project/framework.xpr >> $log_file 34 | export_simulation -force -directory "$root_dir/sim" -simulator ies -lib_map_path "$ies_libs" -ip_user_files_dir "$root_dir/viv_project/framework.ip_user_files" -ipstatic_source_dir "$root_dir/viv_project/framework.ip_user_files/ipstatic" -use_ip_compiled_libs >> $log_file 35 | close_project >> $log_file 36 | -------------------------------------------------------------------------------- /hardware/setup/export_modelsim.tcl: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016-2018, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | 19 | set vivadoVer [version -short] 20 | set root_dir $::env(SNAP_HARDWARE_ROOT) 21 | set mentor_libs $::env(MENTOR_LIBS) 22 | set log_dir $::env(LOGS_DIR) 23 | set log_file $log_dir/compile_$::env(SIMULATOR).log 24 | 25 | puts " export simulation for version=$vivadoVer" 26 | open_project $root_dir/viv_project/framework.xpr >> $log_file 27 | export_simulation -force -directory "$root_dir/sim" -simulator modelsim -lib_map_path "$mentor_libs" -ip_user_files_dir "$root_dir/viv_project/framework.ip_user_files" -ipstatic_source_dir "$root_dir/viv_project/framework.ip_user_files/ipstatic" -use_ip_compiled_libs >> $log_file 28 | close_project >> $log_file 29 | -------------------------------------------------------------------------------- /hardware/setup/export_questa.tcl: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016-2018, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | 19 | set vivadoVer [version -short] 20 | set root_dir $::env(SNAP_HARDWARE_ROOT) 21 | set mentor_libs $::env(MENTOR_LIBS) 22 | set log_dir $::env(LOGS_DIR) 23 | set log_file $log_dir/compile_xsim.log 24 | 25 | puts " export simulation for version=$vivadoVer" 26 | open_project $root_dir/viv_project/framework.xpr >> $log_file 27 | export_simulation -force -directory "$root_dir/sim" -simulator questa -lib_map_path "$mentor_libs" -ip_user_files_dir "$root_dir/viv_project/framework.ip_user_files" -ipstatic_source_dir "$root_dir/viv_project/framework.ip_user_files/ipstatic" -use_ip_compiled_libs >> $log_file 28 | close_project >> $log_file 29 | -------------------------------------------------------------------------------- /hardware/setup/export_xcelium.tcl: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016-2018, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | 19 | set vivadoVer [version -short] 20 | set root_dir $::env(SNAP_HARDWARE_ROOT) 21 | set ies_libs $::env(IES_LIBS) 22 | set log_dir $::env(LOGS_DIR) 23 | set log_file $log_dir/compile_$::env(SIMULATOR).log 24 | set nvme_used $::env(NVME_USED) 25 | 26 | puts " export simulation for version=$vivadoVer" 27 | open_project $root_dir/viv_project/framework.xpr >> $log_file 28 | export_simulation -force -directory "$root_dir/sim" -simulator xcelium -lib_map_path "$ies_libs" -ip_user_files_dir "$root_dir/viv_project/framework.ip_user_files" -ipstatic_source_dir "$root_dir/viv_project/framework.ip_user_files/ipstatic" -use_ip_compiled_libs >> $log_file 29 | close_project >> $log_file 30 | -------------------------------------------------------------------------------- /hardware/setup/export_xsim.tcl: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016-2018, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | 19 | set vivadoVer [version -short] 20 | set root_dir $::env(SNAP_HARDWARE_ROOT) 21 | set log_dir $::env(LOGS_DIR) 22 | set log_file $log_dir/compile_$::env(SIMULATOR).log 23 | 24 | puts " export simulation for version=$vivadoVer" 25 | open_project $root_dir/viv_project/framework.xpr >> $log_file 26 | export_simulation -force -directory "$root_dir/sim" -simulator xsim -ip_user_files_dir "$root_dir/viv_project/framework.ip_user_files" -ipstatic_source_dir "$root_dir/viv_project/framework.ip_user_files/ipstatic" -use_ip_compiled_libs >> $log_file 27 | close_project >> $log_file 28 | -------------------------------------------------------------------------------- /hardware/setup/gen_probe_ltx.tcl: -------------------------------------------------------------------------------- 1 | # 1. Copy this file to hardware/build/Checkpoints 2 | # 2. Usage 3 | # vivado -mode batch -source ./gen_probe_ltx.tcl -notrace 4 | open_checkpoint ../build/Checkpoints/synth_design.dcp 5 | write_debug_probes probe.ltx 6 | close_design 7 | -------------------------------------------------------------------------------- /hardware/setup/patch_NVMe.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Copyright 2019 International Business Machines 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## 17 | set -e 18 | 19 | cp ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_0_0/ip_2/sim/nvme_top_axi_pcie3_0_0_pcie3_ip.v ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_0_0/ip_2/sim/nvme_top_axi_pcie3_0_0_pcie3_ip.patch 20 | grep -v "sigs(pipe_rx" ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_0_0/ip_2/sim/nvme_top_axi_pcie3_0_0_pcie3_ip.patch > ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_0_0/ip_2/sim/nvme_top_axi_pcie3_0_0_pcie3_ip.v 21 | rm ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_0_0/ip_2/sim/nvme_top_axi_pcie3_0_0_pcie3_ip.patch 22 | 23 | cp ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_1_0/ip_2/sim/nvme_top_axi_pcie3_1_0_pcie3_ip.v ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_1_0/ip_2/sim/nvme_top_axi_pcie3_1_0_pcie3_ip.patch 24 | grep -v "sigs(pipe_rx" ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_1_0/ip_2/sim/nvme_top_axi_pcie3_1_0_pcie3_ip.patch > ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_1_0/ip_2/sim/nvme_top_axi_pcie3_1_0_pcie3_ip.v 25 | rm ${SNAP_HARDWARE_ROOT}/ip/nvme/nvme.srcs/sources_1/bd/nvme_top/ip/nvme_top_axi_pcie3_1_0/ip_2/sim/nvme_top_axi_pcie3_1_0_pcie3_ip.patch 26 | -------------------------------------------------------------------------------- /hardware/setup/snap_impl.xdc: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | ## The following set_max_delays constrains are part of the PSL DCP, but 19 | ## Vivado 2016.4 ignores it. 20 | set_max_delay -datapath_only -from [get_ports *b_flash*] 5.000 21 | set_max_delay -datapath_only -from [get_cells -hierarchical -filter {NAME=~ *f/dff_flash_* && IS_SEQUENTIAL == 1}] -to [get_ports *b_flash*] 5.000 22 | set_max_delay -datapath_only -from [get_cells -hierarchical -filter {NAME=~ *f/dff_flash_* && IS_SEQUENTIAL == 1}] -to [get_ports *o_flash*] 5.000 23 | -------------------------------------------------------------------------------- /hardware/setup/snap_timing.xdc: -------------------------------------------------------------------------------- 1 | #----------------------------------------------------------- 2 | # 3 | # Copyright 2016, International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | #----------------------------------------------------------- 18 | #set false path between async clock area. 19 | #This file is only used when action clock frequency != 200MHz 20 | #for 9H7 21 | set_false_path -from [get_clocks oc0_clock_afu] -to [get_clocks clk_out1_user_clock_gen] 22 | set_false_path -from [get_clocks clk_out1_user_clock_gen] -to [get_clocks oc0_clock_afu] 23 | #for 9H3 24 | set_false_path -from [get_clocks clock_afu] -to [get_clocks clk_out1_user_clock_gen] 25 | set_false_path -from [get_clocks clk_out1_user_clock_gen] -to [get_clocks clock_afu] 26 | -------------------------------------------------------------------------------- /hardware/setup/unit_sim.tcl: -------------------------------------------------------------------------------- 1 | set_property used_in_simulation true [get_files $fpga_top_src_dir/oc_fpga_top.v] 2 | #set_property used_in_simulation true [get_files oc_bsp_wrap.xci] 3 | 4 | #foreach verif_file [glob -nocomplain -dir $root_dir/sim/unit_verif */*] { 5 | # set_property file_type SystemVerilog [get_files $verif_file] >> $log_file 6 | # set_property used_in_simulation true [get_files $verif_file] >> $log_file 7 | # set_property used_in_synthesis false [get_files $verif_file] >> $log_file 8 | # set_property used_in_implementation false [get_files $verif_file] >> $log_file 9 | #} 10 | 11 | foreach hw_file [glob -nocomplain -dir $action_hw_dir/hdl *.v] { 12 | set_property file_type SystemVerilog [get_files $hw_file] >> $log_file 13 | set_property used_in_simulation true [get_files $hw_file] >> $log_file 14 | set_property used_in_synthesis false [get_files $hw_file] >> $log_file 15 | set_property used_in_implementation false [get_files $hw_file] >> $log_file 16 | } 17 | 18 | -------------------------------------------------------------------------------- /hardware/setup/util.tcl: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | ############################################################################# 3 | ### 4 | ### Copyright 2016-2019 International Business Machines 5 | ### Copyright 2019 Filip Leonarski, Paul Scherrer Institute 6 | ### 7 | ### Licensed under the Apache License, Version 2.0 (the "License"); 8 | ### you may not use this file except in compliance with the License. 9 | ### You may obtain a copy of the License at 10 | ### 11 | ### http://www.apache.org/licenses/LICENSE-2.0 12 | ### 13 | ### Unless required by applicable law or agreed to in writing, software 14 | ### distributed under the License is distributed on an "AS IS" BASIS, 15 | ### WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ### See the License for the specific language governing permissions AND 17 | ### limitations under the License. 18 | ### 19 | ############################################################################# 20 | ############################################################################# 21 | # 22 | proc addip {ipName displayName} { 23 | set vlnv_version_independent [lindex [get_ipdefs -all -filter "NAME == $ipName"] end] 24 | create_bd_cell -type ip -vlnv $vlnv_version_independent $displayName 25 | } 26 | -------------------------------------------------------------------------------- /hardware/sim/README.md: -------------------------------------------------------------------------------- 1 | # OC-Accel Sim 2 | 3 | This subdirectory contains OC-Accel scripts for simulation, as well as simulation ouput files. 4 | 5 | Note: 6 | 1. To run simulation with HBM on Xilinx Vivado 2018.3, need to use Cadence Xcelium 18.03.010 simulator or newer version, and apply Xilinx AR#71795 solution. 7 | Check for detailed information. 8 | 2. To run simulation with HBM on Xilinx Vivado 2019.2, need to use Cadence Xcelium 19.03.008 simulator or newer version. 9 | -------------------------------------------------------------------------------- /hardware/sim/fastest.parms: -------------------------------------------------------------------------------- 1 | # pslse.parms is a hard coded file name for the PSLSE parameters file. 2 | # This file can be used to override the default settings of parameters. 3 | # 4 | # File may contain comment lines starting with '#' or blank lines. 5 | # 6 | # For parameter lines the format is the following: 7 | # PARM:{value} 8 | # PARM:{min_value},{max_value} 9 | # 10 | # When min_value and max_value are provided then for each run PSLSE 11 | # will pick a random value in that range. 12 | # 13 | 14 | # Timeout delay in seconds: If 0 then timeouts are disabled. 15 | # NOTE: Must be a single value, not a min,max range 16 | #TIMEOUT:10 17 | 18 | # Credits: Normally the 64 will always provide 64 credits. Tweaking this 19 | # value is primarily for PSLSE testing purposes only. 20 | # NOTE: Must be a single value, not a min,max range 21 | #CREDITS:64 22 | 23 | # Randomization seed. Set this to force reproducable sequence of event 24 | # NOTE: Must be a single value, not a min,max range 25 | SEED:13 26 | 27 | # Percentage chance of PSL driving any pending responses in a clock cycle. 28 | # Can not be 0 otherwise PSL will never generate responses to commands. 29 | # Setting to 100 will cause all responses to be very rapid and generally 30 | # those responses will be in order. 31 | # Lower values introduces delays on responses and allows for greater 32 | # randomization of response ordering. 33 | RESPONSE_PERCENT:99,100 34 | 35 | # Percentage chance of PSL responding with PAGED for any command response. 36 | PAGED_PERCENT:0,0 37 | 38 | # Percentage chance of PSL reordering the execution of commands. 39 | REORDER_PERCENT:0,0 40 | 41 | # Percentage chance of PSL generating extra buffer read/write activity. 42 | BUFFER_PERCENT:0,0 43 | -------------------------------------------------------------------------------- /hardware/sim/ncaet.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | database -open capiWave -incsize 2000M -incfiles 2 17 | probe -create -memories -all -depth 2 18 | probe -create -all -depth 10 ;# depth3 is 6x smaller than depth7 19 | probe -all -memories -depth all 20 | -------------------------------------------------------------------------------- /hardware/sim/ncrun.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | version ;# show irun version 17 | assertion -off -all ;# Disable all assertion fails prior to reset done. 18 | #input ncaet.tcl ;# enabled through run_sim 19 | set intovf_severity_level {warning}; 20 | set myrc [run 2000 ns]; puts "run2000 rc= $myrc" ;# assertions off until after 2800ns 21 | assertion -on -all ;# Turn assertions back on after reset is done. 22 | set severity_pack_assert_off {warning} 23 | set pack_assert_off { ieee.std_logic_arith ieee.numeric_std } 24 | #run 50000 ns ;# limit test length 25 | run ;# runforever, until application closes sim 26 | assertion -summary 27 | exit 28 | -------------------------------------------------------------------------------- /hardware/sim/nvme_lite/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright International Business Machines 2018 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | SHELL=/bin/bash 18 | SIMULATOR?="nosim" 19 | SNAP_CONFIG=$(SNAP_ROOT)/.snap_config 20 | 21 | all: snap_config.sv 22 | 23 | # 24 | # FIXME We might like to generate a full snap_config.sv at a global place 25 | # for all SystemVerilog/Verilog sources, such that we can use that 26 | # to feed the Verilog preprocessor. I tried my luck with cpp but that 27 | # had trouble with simple 's where the processing stopped demanding 28 | # a closing '. 29 | # 30 | snap_config.sv: $(SNAP_CONFIG) 31 | echo "/* SNAP_CONFIG */" > snap_config.sv 32 | grep "SIM_XSIM=y" $(SNAP_CONFIG); \ 33 | if [ $$? -eq 0 ]; then \ 34 | echo "\`define SIM_XSIM 1" >> snap_config.sv ; \ 35 | fi 36 | 37 | clean: 38 | $(RM) snap_config.sv 39 | -------------------------------------------------------------------------------- /hardware/sim/testlist_simple.sh: -------------------------------------------------------------------------------- 1 | ../../../../actions/$ACT/tests/hw_test.sh -d SHORT 2 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/action_bfm/action_bfm_pkg.svh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _ACTION_BFM_PKG_SVH_ 17 | `define _ACTION_BFM_PKG_SVH_ 18 | 19 | `include "../../../hdl/core/snap_global_vars.v" 20 | 21 | //CONFIG 22 | `include "act_cfg_obj.sv" 23 | 24 | //SEQUENCE 25 | `include "action_seqr.sv" 26 | `include "action_seqr_st.sv" 27 | 28 | //AGENTS 29 | `ifndef ENABLE_ODMA 30 | `include "axi_mm_mst_agent.sv" 31 | `else 32 | `ifndef ENABLE_ODMA_ST_MODE 33 | `include "axi_mm_slv_agent.sv" 34 | `else 35 | `include "axi_st_slv_agent.sv" 36 | `include "axi_st_mst_agent.sv" 37 | `endif 38 | `endif 39 | `include "axi_lite_slv_agent.sv" 40 | `include "action_agent.sv" 41 | 42 | `endif // _ACTION_BFM_PKG_SVH_ 43 | 44 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/action_bfm/action_seqr.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _ACTION_SEQR_SV 17 | `define _ACTION_SEQR_SV 18 | 19 | class action_seqr extends uvm_sequencer #(axi_mm_transaction); 20 | 21 | `uvm_component_utils(action_seqr) 22 | 23 | function new (string name="action_seqr", uvm_component parent); 24 | super.new(name, parent); 25 | endfunction: new 26 | 27 | endclass: action_seqr 28 | 29 | `endif 30 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/action_bfm/action_seqr_st.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _ACTION_SEQR_ST_SV 17 | `define _ACTION_SEQR_ST_SV 18 | 19 | class action_seqr_st extends uvm_sequencer #(axi_st_transaction); 20 | 21 | `uvm_component_utils(action_seqr_st) 22 | 23 | function new (string name="action_seqr_st", uvm_component parent); 24 | super.new(name, parent); 25 | endfunction: new 26 | 27 | endclass: action_seqr_st 28 | 29 | `endif 30 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/env/tb_vseqr.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TB_VSEQR_SV 17 | `define _TB_VSEQR_SV 18 | 19 | class tb_vseqr extends uvm_sequencer; 20 | 21 | tl_tx_seqr tx_sqr; 22 | tl_cfg_obj cfg_obj; 23 | tl_agent tl_agt; 24 | host_mem_model host_mem; 25 | brdg_cfg_obj brdg_cfg; 26 | act_cfg_obj act_cfg; 27 | action_agent action_agt; 28 | action_seqr act_sqr; 29 | action_seqr_st act_sqr_st; 30 | 31 | `uvm_component_utils_begin(tb_vseqr) 32 | `uvm_field_object (cfg_obj, UVM_ALL_ON) 33 | `uvm_component_utils_end 34 | 35 | function new(string name="tb_vseqr", uvm_component parent); 36 | super.new(name, parent); 37 | endfunction: new 38 | 39 | endclass: tb_vseqr 40 | 41 | `endif 42 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/env/dlx_tlx_interface.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | //------------------------------------------------------------------------------ 17 | // 18 | // CLASS: dlx_tlx_interface 19 | // 20 | //------------------------------------------------------------------------------ 21 | `ifndef _DLX_TLX_INTERFACE_SV 22 | `define _DLX_TLX_INTERFACE_SV 23 | 24 | interface dlx_tlx_interface (input clock); 25 | 26 | logic [31:0] dlx_config_info; 27 | logic [2:0] dlx_tlx_init_flit_depth; 28 | logic [511:0] dlx_tlx_flit; 29 | logic dlx_tlx_flit_crc_err; 30 | logic dlx_tlx_flit_credit; 31 | logic dlx_tlx_flit_valid; 32 | logic dlx_tlx_link_up; 33 | 34 | logic [3:0] tlx_dlx_debug_encode; 35 | logic [31:0] tlx_dlx_debug_info; 36 | logic [511:0] tlx_dlx_flit; 37 | logic tlx_dlx_flit_valid; 38 | 39 | endinterface: dlx_tlx_interface 40 | 41 | `endif 42 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/env/tl_bfm_pkg.svh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TL_BFM_PKG_SVH_ 17 | `define _TL_BFM_PKG_SVH_ 18 | 19 | //CONFIG 20 | //INTERFACE & TRANSACTIONS 21 | //MANAGER 22 | `include "../util/util.svh" 23 | 24 | //SCOREBOARDS 25 | `include "../sb/sb.svh" 26 | 27 | //MONITORS 28 | //DRIVER 29 | //AGENTS 30 | `include "../tl/tl.svh" 31 | 32 | //TL BFM TOP 33 | //`include "tl_bfm_env.sv" 34 | 35 | //TEST LIST 36 | `include "../seq_lib/test_list.svh" 37 | 38 | `endif // _TL_BFM_PKG_SVH_ 39 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/sb/sb.svh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _SB_SVH 17 | `define _SB_SVH 18 | 19 | 20 | `include "tl_mem_model.sv" 21 | `include "tl_scoreboard.sv" 22 | 23 | `endif 24 | 25 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/seq_lib/test_list.svh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TEST_LIST_SVH 17 | `define _TEST_LIST_SVH 18 | 19 | `include "bfm_sequence_base.sv" 20 | `include "bfm_seq_lib.sv" 21 | `include "bfm_seq_lib_rand_resp.sv" 22 | `include "bfm_seq_lib_rand_axi.sv" 23 | `include "bfm_seq_lib_rand_axi_resp.sv" 24 | `include "odma_seq_lib.sv" 25 | `include "odma_seq_lib_unalign.sv" 26 | `include "odma_seq_lib_st.sv" 27 | `include "bfm_seq_lib_mmio_intrp.sv" 28 | 29 | `endif 30 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/tl/tl.svh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TL_SVH 17 | `define _TL_SVH 18 | 19 | `include "tl_dl_if.sv" 20 | `include "tl_tx_driver.sv" 21 | `include "tl_tx_monitor.sv" 22 | `include "tl_tx_seqr.sv" 23 | `include "tl_rx_monitor.sv" 24 | `include "tl_agent.sv" 25 | 26 | `endif 27 | 28 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/tl/tl_dl_if.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TL_DL_IF_SV 17 | `define _TL_DL_IF_SV 18 | 19 | interface tl_dl_if (input logic clock); 20 | //Reset 21 | logic chip_reset; 22 | //TL to DL Outputs 23 | logic tl_dl_flit_early_vld; 24 | logic tl_dl_flit_vld; 25 | logic [511:0] tl_dl_flit_data; 26 | logic [ 15:0] tl_dl_flit_ecc; 27 | logic tl_dl_flit_lbip_vld; 28 | logic [ 81:0] tl_dl_flit_lbip_data; 29 | logic [ 15:0] tl_dl_flit_lbip_ecc; 30 | logic tl_dl_tl_error; 31 | logic tl_dl_tl_event; 32 | logic [ 1:0] tl_dl_lane_width_desired; 33 | //DL to TL Inputs 34 | logic dl_tl_flit_vld; 35 | logic dl_tl_flit_error; 36 | logic [511:0] dl_tl_flit_data; 37 | logic [ 15:0] dl_tl_flit_pty; 38 | logic dl_tl_flit_credit; 39 | logic dl_tl_link_up; 40 | logic [ 1:0] dl_tl_lane_width_status; 41 | logic [ 2:0] dl_tl_init_flit_depth; 42 | 43 | endinterface: tl_dl_if 44 | 45 | `endif 46 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/tl/tl_tx_seqr.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TL_TX_SEQR_SV 17 | `define _TL_TX_SEQR_SV 18 | 19 | class tl_tx_seqr extends uvm_sequencer #(tl_tx_trans, tl_trans); 20 | 21 | `uvm_component_utils(tl_tx_seqr) 22 | 23 | function new (string name="tl_tx_seqr", uvm_component parent); 24 | super.new(name, parent); 25 | endfunction: new 26 | 27 | endclass: tl_tx_seqr 28 | 29 | `endif 30 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/util/dl_credit_trans.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _TL_CREDIT_TRANS_SV 17 | `define _TL_CREDIT_TRANS_SV 18 | 19 | class dl_credit_trans extends uvm_transaction; 20 | int return_credit = 0; 21 | 22 | `uvm_object_utils_begin(dl_credit_trans) 23 | `uvm_field_int(return_credit, UVM_ALL_ON) 24 | `uvm_object_utils_end 25 | 26 | function new(string name="dl_credit_trans"); 27 | super.new(name); 28 | endfunction: new 29 | 30 | endclass: dl_credit_trans 31 | 32 | `endif 33 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/tl_bfm/util/util.svh: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef _UTIL_SVH 17 | `define _UTIL_SVH 18 | 19 | `include "tl_cfg_obj.sv" 20 | `include "tl_tx_trans.sv" 21 | `include "tl_rx_trans.sv" 22 | `include "dl_credit_trans.sv" 23 | `include "host_mem_model.sv" 24 | `include "tl_manager.sv" 25 | `include "tl_trans.sv" 26 | 27 | `endif 28 | 29 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/util/axi_lite_transaction.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | `ifndef AXI_LITE_TRANSACTION_SV 17 | `define AXI_LITE_TRANSACTION_SV 18 | 19 | class axi_lite_transaction extends uvm_sequence_item; 20 | 21 | typedef enum bit { LITE_READ = 1'b0, LITE_WRITE = 1'b1} trans_type; 22 | 23 | rand bit [31:0] addr; 24 | rand bit [31:0] data; 25 | rand bit [3 :0] strobe; 26 | rand trans_type t_type; 27 | 28 | `uvm_object_utils_begin(axi_lite_transaction) 29 | `uvm_field_int (addr, UVM_ALL_ON) 30 | `uvm_field_int (data, UVM_ALL_ON) 31 | `uvm_field_int (strobe, UVM_ALL_ON) 32 | `uvm_field_enum (trans_type, t_type, UVM_ALL_ON) 33 | `uvm_object_utils_end 34 | 35 | function new (string name = "axi_lite_transaction_inst"); 36 | super.new(name); 37 | endfunction : new 38 | 39 | function string convert2string(); 40 | return $sformatf("addr = 0x%h\ndata = 0x%h\nstrb = 0x%h\n", addr, data, strobe); 41 | endfunction : convert2string 42 | 43 | endclass : axi_lite_transaction 44 | `endif 45 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/util/axi_st_transaction.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | //------------------------------------------------------------------------------ 18 | // 19 | // CLASS: axi_st_transaction 20 | // 21 | //------------------------------------------------------------------------------ 22 | `ifndef AXI_ST_TRANSACTION_SV 23 | `define AXI_ST_TRANSACTION_SV 24 | 25 | 26 | class axi_st_transaction extends uvm_sequence_item; 27 | 28 | typedef enum bit { H2A, A2H } uvm_axi_txn_e; 29 | 30 | rand bit [1023:0] data; 31 | rand bit [127:0] tkeep; 32 | rand bit [4:0] tid; 33 | rand bit [8:0] tuser; 34 | rand bit tlast; 35 | rand uvm_axi_txn_e trans; 36 | 37 | `uvm_object_utils_begin(axi_st_transaction) 38 | `uvm_field_int (data, UVM_ALL_ON) 39 | `uvm_field_int (tkeep, UVM_ALL_ON) 40 | `uvm_field_int (tid, UVM_ALL_ON) 41 | `uvm_field_int (tuser, UVM_ALL_ON) 42 | `uvm_field_int (tlast, UVM_ALL_ON) 43 | `uvm_field_enum (uvm_axi_txn_e, trans, UVM_ALL_ON) 44 | `uvm_object_utils_end 45 | 46 | // new - constructor 47 | function new (string name = "axi_st_transaction_inst"); 48 | super.new(name); 49 | endfunction : new 50 | 51 | endclass : axi_st_transaction 52 | 53 | `endif 54 | 55 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/util/intrp_interface.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | //------------------------------------------------------------------------------ 17 | // 18 | // CLASS: intrp_interface 19 | // 20 | //------------------------------------------------------------------------------ 21 | `ifndef _INTRP_INTERFACE_SV 22 | `define _INTRP_INTERFACE_SV 23 | 24 | interface intrp_interface (input logic action_clock, input logic action_rst_n); 25 | 26 | logic intrp_req; 27 | logic intrp_ack; 28 | logic [63:0] intrp_src; 29 | logic [8:0] intrp_ctx; 30 | 31 | endinterface: intrp_interface 32 | 33 | `endif 34 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/util/intrp_transaction.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | //------------------------------------------------------------------------------ 18 | // 19 | // CLASS: intrp_transaction 20 | // 21 | //------------------------------------------------------------------------------ 22 | `ifndef INTRP_TRANSACTION_SV 23 | `define INTRP_TRANSACTION_SV 24 | 25 | 26 | class intrp_transaction extends uvm_sequence_item; 27 | 28 | typedef enum bit { INTRP_REQ, INTRP_ACK } uvm_intrp_txn; 29 | 30 | rand bit [63:0] intrp_src; 31 | rand bit [8:0] intrp_ctx; 32 | rand uvm_intrp_txn intrp_item; 33 | 34 | `uvm_object_utils_begin(intrp_transaction) 35 | `uvm_field_int (intrp_src, UVM_ALL_ON) 36 | `uvm_field_int (intrp_ctx, UVM_ALL_ON) 37 | `uvm_field_enum (uvm_intrp_txn, intrp_item, UVM_ALL_ON) 38 | `uvm_object_utils_end 39 | 40 | // new - constructor 41 | function new (string name = "intrp_transaction_inst"); 42 | super.new(name); 43 | endfunction : new 44 | 45 | endclass : intrp_transaction 46 | 47 | `endif 48 | 49 | -------------------------------------------------------------------------------- /hardware/sim/unit_verif/util/odma_desp_transaction.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | `ifndef ODMA_DESP_TRANSACTION_SV 18 | `define ODMA_DESP_TRANSACTION_SV 19 | 20 | class odma_desp_transaction extends uvm_sequence_item; 21 | 22 | bit[15:0] magic; 23 | bit[5:0] nxt_adj; 24 | bit[7:0] control; 25 | bit stop; 26 | bit st_eop; 27 | bit[27:0] length; 28 | bit[63:0] src_adr; 29 | bit[63:0] dst_adr; 30 | bit[63:0] nxt_adr; 31 | 32 | `uvm_object_utils_begin(odma_desp_transaction) 33 | `uvm_field_int (magic, UVM_ALL_ON) 34 | `uvm_field_int (nxt_adj, UVM_ALL_ON) 35 | `uvm_field_int (control, UVM_ALL_ON) 36 | `uvm_field_int (stop, UVM_ALL_ON) 37 | `uvm_field_int (st_eop, UVM_ALL_ON) 38 | `uvm_field_int (length, UVM_ALL_ON) 39 | `uvm_field_int (src_adr, UVM_ALL_ON) 40 | `uvm_field_int (dst_adr, UVM_ALL_ON) 41 | `uvm_field_int (nxt_adr, UVM_ALL_ON) 42 | `uvm_object_utils_end 43 | 44 | function new (string name = "odma_desp_transaction_inst"); 45 | super.new(name); 46 | endfunction : new 47 | 48 | endclass : odma_desp_transaction 49 | `endif 50 | -------------------------------------------------------------------------------- /hardware/sim/xsaet.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | ############################################################################### 17 | ##### use native format 18 | #open_wave_database native 19 | #get_objects -verbose -recursive -filter { type == internal_signal } *fsm* 20 | add_wave -r * 21 | save_wave_config all.wcfg 22 | ##### use VCD format 23 | #open_vcd {dump.vcd} 24 | #log_vcd * 25 | #log_vcd -verbose * 26 | #log_vcd -level 9 -verbose * 27 | #log_vcd -level 5 [get_objects -filter { type == port } /* ] 28 | #log_vcd [get_objects -filter { type == internal_signal } * ] 29 | #limit_vcd 200000000 30 | -------------------------------------------------------------------------------- /hardware/sim/xsrun.tcl: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, International Business Machines 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | ############################################################################### 17 | version 18 | #source xsaet.tcl ;# enabled through run_sim 19 | set myrc [run 2000 ns]; puts "run2000 rc= $myrc" ;# assertions off until after 2800ns 20 | #run 50000 ns 21 | run -all ;# run forever, until application closes sim 22 | #save_wave_config 23 | #flush_vcd 24 | #close_vcd 25 | exit 26 | -------------------------------------------------------------------------------- /ocaccel_workflow.py: -------------------------------------------------------------------------------- 1 | scripts/ide/ocaccel_workflow.py -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | build -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # 4 | 5 | all: 6 | 7 | .PHONY += help 8 | help: 9 | @echo "SNAP configuration system" 10 | @echo 11 | @echo " Please ensure that you have installed your Linux kernel" 12 | @echo " sources and the tools to build and configure it. We are" 13 | @echo " using the same infrastructure to generate the SNAP" 14 | @echo " configuration files." 15 | @echo 16 | @echo "Possible targets are:" 17 | @echo " menuconfig - use menuconfig/ncurses" 18 | @echo " gconfig - use gconfig/GTK+" 19 | @echo " xconfig - use xconfig/QT" 20 | @echo " config - use config/command line version" 21 | @echo " prepare - generate configuration specific header." 22 | @echo 23 | 24 | .PHONY += menuconfig gconfig xconfig config oldconfig silentoldconfig prepare clean distclean 25 | menuconfig gconfig xconfig config oldconfig silentoldconfig prepare: 26 | ./snap_cfg -o $@ 2>/dev/null 27 | 28 | install: 29 | 30 | uninstall: 31 | 32 | clean: 33 | $(RM) build/config build/*~ *~ 34 | $(RM) ide/*.pyc 35 | 36 | distclean: clean 37 | $(RM) ../software/include/autoconf.h 38 | -------------------------------------------------------------------------------- /scripts/ide/env_clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import os 19 | import sys 20 | from ocaccel_utils import run_and_wait 21 | from ocaccel_utils import msg 22 | 23 | def env_clean(log): 24 | msg.ok_msg_blue("--------> Clean the environment") 25 | rc = run_and_wait(cmd = "make clean", work_dir = ".", log = log) 26 | if rc == 0: 27 | msg.ok_msg("Environment clean DONE") 28 | else: 29 | msg.fail_msg("Error running 'make clean'! Exiting ...") 30 | 31 | rc = run_and_wait(cmd = "make clean_config", work_dir = ".", log = log) 32 | if rc == 0: 33 | msg.ok_msg("Configuration clean DONE") 34 | else: 35 | msg.fail_msg("Error running 'make clean_config'! Exiting ...") 36 | 37 | if __name__ == '__main__': 38 | env_clean('./snap_workflow.log') 39 | 40 | -------------------------------------------------------------------------------- /scripts/ide/make_cloud_action.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import os 19 | import sys 20 | from os.path import join as pathjoin 21 | from ocaccel_utils import run_and_poll_with_progress 22 | from ocaccel_utils import msg 23 | 24 | def make_cloud_action(log, options = None): 25 | msg.ok_msg_blue("--------> Make the CLOUD ACTION FPGA image in Partial Reconfiguration mode") 26 | msg.warn_msg("Building an image might take quite a long time to finish, be patient ... ") 27 | rc = run_and_poll_with_progress(cmd = "make cloud_action", work_dir = ".", log = log, max_log_len = 120, timeout = options.make_timeout) 28 | 29 | if rc == 0: 30 | msg.ok_msg("===========================") 31 | msg.ok_msg("action FPGA image generated") 32 | msg.ok_msg("===========================") 33 | msg.ok_msg("Images are available in %s" % pathjoin(options.ocaccel_root, 'hardware', 'build', 'Images')) 34 | else: 35 | msg.warn_msg("Failed to make cloud action image , check log in %s" % log) 36 | msg.warn_msg("Failed to make cloud action image ! Exiting ... ") 37 | msg.warn_msg("Here are some of the error logs:") 38 | f = open(log,"r") 39 | l = f.readlines() 40 | f.close() 41 | print "".join(l[-10:]) 42 | msg.fail_msg("End of the error log!") 43 | 44 | if __name__ == '__main__': 45 | make_cloud_action("./make_cloud_action.log") 46 | -------------------------------------------------------------------------------- /scripts/ide/make_cloud_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import os 19 | import sys 20 | from os.path import join as pathjoin 21 | from ocaccel_utils import run_and_poll_with_progress 22 | from ocaccel_utils import msg 23 | 24 | def make_cloud_base(log, options = None): 25 | msg.ok_msg_blue("--------> Make the CLOUD BASE FPGA image in Partial Reconfiguration mode") 26 | msg.warn_msg("Building an image might take quite a long time to finish, be patient ... ") 27 | rc = run_and_poll_with_progress(cmd = "make cloud_base", work_dir = ".", log = log, max_log_len = 120, timeout = options.make_timeout) 28 | 29 | if rc == 0: 30 | msg.ok_msg("=========================") 31 | msg.ok_msg("base FPGA image generated") 32 | msg.ok_msg("=========================") 33 | msg.ok_msg("Images are available in %s" % pathjoin(options.ocaccel_root, 'hardware', 'build', 'Images')) 34 | else: 35 | msg.warn_msg("Failed to make cloud base image, check log in %s" % log) 36 | msg.warn_msg("Failed to make cloud base image ! Exiting ... ") 37 | msg.warn_msg("Here are some of the error logs:") 38 | f = open(log,"r") 39 | l = f.readlines() 40 | f.close() 41 | print "".join(l[-10:]) 42 | msg.fail_msg("End of the error log!") 43 | 44 | if __name__ == '__main__': 45 | make_cloud_base("./make_cloud_base.log") 46 | -------------------------------------------------------------------------------- /scripts/ide/make_image.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import os 19 | import sys 20 | from os.path import join as pathjoin 21 | from ocaccel_utils import run_and_poll_with_progress 22 | from ocaccel_utils import msg 23 | 24 | def make_image(log, options = None): 25 | msg.ok_msg_blue("--------> Make the FPGA image") 26 | msg.warn_msg("Make image might take quite a long time to finish, be patient ... ") 27 | rc = run_and_poll_with_progress(cmd = "make image", work_dir = ".", log = log, max_log_len = 120, timeout = options.make_timeout) 28 | 29 | if rc == 0: 30 | msg.ok_msg("====================") 31 | msg.ok_msg("FPGA image generated") 32 | msg.ok_msg("====================") 33 | msg.ok_msg("Images are available in %s" % pathjoin(options.ocaccel_root, 'hardware', 'build', 'Images')) 34 | else: 35 | msg.warn_msg("Failed to make image, check log in %s" % log) 36 | msg.warn_msg("Failed to make image! Exiting ... ") 37 | msg.warn_msg("Here are some of the error logs:") 38 | f = open(log,"r") 39 | l = f.readlines() 40 | f.close() 41 | print "".join(l[-10:]) 42 | msg.fail_msg("End of the error log!") 43 | 44 | if __name__ == '__main__': 45 | make_image("./make_image.log") 46 | -------------------------------------------------------------------------------- /scripts/ide/make_model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 International Business Machines 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | import os 19 | import sys 20 | from ocaccel_utils import run_and_poll_with_progress 21 | from ocaccel_utils import msg 22 | 23 | def make_model(log, timeout = 2592000): 24 | msg.ok_msg_blue("--------> Make the simulation model") 25 | rc = run_and_poll_with_progress(cmd = "make model", work_dir = ".", log = log, max_log_len = 150, timeout = timeout) 26 | 27 | if rc == 0: 28 | msg.ok_msg("SNAP simulation model generated") 29 | else: 30 | msg.warn_msg("Failed to make simulation model, check log in %s" % log) 31 | msg.fail_msg("Failed to make simulation model! Exiting ... ") 32 | 33 | if __name__ == '__main__': 34 | make_model("./make_model.log") 35 | -------------------------------------------------------------------------------- /scripts/jenkins_sanity_image.ksh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DEFCONF="AD9V3.hdl_example.SDRAM.defconfig" 4 | 5 | if [[ ! -z $1 ]]; then 6 | DEFCONF=$1 7 | fi 8 | 9 | . ./setup_tools.ksh 10 | 11 | ./ocaccel_workflow.py -c --simulator=nosim --no_make_model --no_run_sim --predefined_config $DEFCONF --make_image 12 | 13 | if [[ $? -eq 0 ]]; then 14 | echo "Make image PASSED" 15 | exit 0 16 | fi 17 | 18 | echo "Make image FAILED" 19 | exit 1 20 | -------------------------------------------------------------------------------- /scripts/jenkins_sanity_sim.ksh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ -z $1 ]]; then 4 | OCSE_ROOT=../ocse 5 | else 6 | OCSE_ROOT=$1 7 | fi 8 | 9 | if [[ -z $2 ]]; then 10 | IESL=${HOME}/vol0/xcelium_lib 11 | else 12 | IESL=$2 13 | fi 14 | 15 | SNAP_ROOT=`pwd` 16 | . ./setup_tools.ksh 17 | 18 | export IES_LIBS=$IESL 19 | echo "Setting IES_LIBS to ${IES_LIBS}" 20 | 21 | ./ocaccel_workflow.py -c --simulator xcelium --unit_sim --unit_test bfm_test_rd_wr_10_size7_randlen_randid_rand_resp 22 | if [ $? -ne 0 ]; then 23 | echo "UVM check FAILED for bridge mode!" 24 | exit 1 25 | fi 26 | 27 | ./ocaccel_workflow.py -c --simulator xcelium --unit_sim --odma --unit_test odma_test_chnl4_list2to4_block2to4_dsc1to64_mixdrt_less4k 28 | if [ $? -ne 0 ]; then 29 | echo "UVM check FAILED for odma mode!" 30 | exit 1 31 | fi 32 | 33 | echo "UVM check PASSED for both bridge mode and odma mode!" 34 | exit 0 35 | -------------------------------------------------------------------------------- /scripts/odma_regression_list: -------------------------------------------------------------------------------- 1 | odma_test_block1_dsc1_a2h_4k 2 | odma_test_block1_dsc1_h2a_4k 3 | odma_test_block1_dsc4_a2h_4k 4 | odma_test_block1_dsc1_h2a_4k 5 | odma_test_block1_dsc4_a2h_less64k 6 | odma_test_block1_dsc4_h2a_less64k 7 | odma_test_block2to4_randdsc_a2h_less64k 8 | odma_test_block2to4_randdsc_h2a_less64k 9 | odma_test_block1to32_randdsc_a2h_less64k 10 | odma_test_block1to32_randdsc_h2a_less64k 11 | odma_test_block2to4_dsc1to8_a2h_hardlen 12 | odma_test_block2to4_dsc1to8_h2a_hardlen 13 | odma_test_list2to4_block2to4_randdsc_a2h_less64k 14 | odma_test_list2to4_block2to4_randdsc_h2a_less64k 15 | odma_test_chnl4_block2to4_dsc1to8_a2h_less64k 16 | odma_test_chnl4_block2to4_dsc1to8_h2a_less64k 17 | odma_test_chnl4_list2to4_block2to4_dsc1to8_a2h_less64k 18 | odma_test_chnl4_list2to4_block2to4_dsc1to8_h2a_less64k 19 | odma_test_chnl4_list2to4_block2to4_dsc1to8_mixdrt_less64k 20 | odma_test_chnl4_list2to4_block2to4_dsc1to8_mixdrt_hardlen 21 | -------------------------------------------------------------------------------- /scripts/regression_list: -------------------------------------------------------------------------------- 1 | bfm_test_read_4k_write_4k_n1_rand_resp 2 | bfm_test_read_4k_write_4k_n64_rand_resp 3 | bfm_test_read_4k_write_4k_n1024_rand_resp 4 | bfm_test_read_4k_write_4k_n2048_rand_resp 5 | bfm_test_read_4k_write_4k_n4096_rand_resp 6 | bfm_test_read_4k_write_4k_n2048_rand_resp_split 7 | bfm_test_read_4k_write_4k_n4096_rand_resp_split 8 | bfm_test_rd_wr_1000_size6_randlen_randid 9 | bfm_test_rd_wr_1000_randsize_randlen_unaligned_randid 10 | bfm_test_rd_wr_1000_randsize_randlen_strobe_unaligned_randid 11 | bfm_test_rd_wr_1024_size6_randlen_randid_rand_resp 12 | bfm_test_rd_wr_1024_randsize_randlen_randid_rand_resp 13 | bfm_test_rd_wr_1024_randsize_randlen_unaligned_randid_rand_resp 14 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/README.md: -------------------------------------------------------------------------------- 1 | # A tool to support embedded perl in verilog/vhdl 2 | 3 | You can use the following syntax to insert perl in verilog: 4 | 5 | test.v: 6 | ``` 7 | module foo (); 8 | //: my $x = X; 9 | //: my $y = Y; 10 | //: for (my $i = 0; $i < 16; $i++) { 11 | //: print qq( 12 | //: wire [$x*$y:0] bufin_pd_$i; 13 | //: ); 14 | //: } 15 | 16 | endmodule 17 | 18 | ``` 19 | 20 | def.h: 21 | ``` 22 | #define X 8 23 | #define Y 8 24 | 25 | ``` 26 | 27 | Run command: 28 | ``` 29 | $ ./vcp -i test.v -o test.v.vcp -imacros ./def.h -cpp /bin/cpp 30 | $ perl -I ./plugins -Meperl ./eperl -o test.v.generated test.v.vcp 31 | ``` 32 | 33 | In test.v.generated, you will see: 34 | ``` 35 | module foo (); 36 | //: my $x = 8; 37 | //: my $y = 8; 38 | //: for (my $i = 0; $i < 16; $i++) { 39 | //: print qq( 40 | //: wire [$x*$y:0] bufin_pd_$i; 41 | //: ); 42 | //: } 43 | //| eperl: generated_beg (DO NOT EDIT BELOW) 44 | 45 | wire [8*8:0] bufin_pd_0; 46 | 47 | wire [8*8:0] bufin_pd_1; 48 | 49 | wire [8*8:0] bufin_pd_2; 50 | 51 | wire [8*8:0] bufin_pd_3; 52 | 53 | wire [8*8:0] bufin_pd_4; 54 | 55 | wire [8*8:0] bufin_pd_5; 56 | 57 | wire [8*8:0] bufin_pd_6; 58 | 59 | wire [8*8:0] bufin_pd_7; 60 | 61 | wire [8*8:0] bufin_pd_8; 62 | 63 | wire [8*8:0] bufin_pd_9; 64 | 65 | wire [8*8:0] bufin_pd_10; 66 | 67 | wire [8*8:0] bufin_pd_11; 68 | 69 | wire [8*8:0] bufin_pd_12; 70 | 71 | wire [8*8:0] bufin_pd_13; 72 | 73 | wire [8*8:0] bufin_pd_14; 74 | 75 | wire [8*8:0] bufin_pd_15; 76 | 77 | //| eperl: generated_end (DO NOT EDIT ABOVE) 78 | endmodule 79 | ``` 80 | 81 | # The tool is copied from the open source project NVDLA 82 | 83 | See details in github: 84 | `https://github.com/nvdla/hw/tree/nvdlav1/tools/bin` 85 | 86 | `https://github.com/nvdla/hw/tree/nvdlav1/vmod/plugins` 87 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/plugins/EperlUtil.pm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | package EperlUtil; 4 | use strict; 5 | use warnings FATAL => qw(all); 6 | 7 | use base ("Exporter"); 8 | our @EXPORT = qw( 9 | vprintl 10 | vprinti 11 | ); 12 | 13 | sub vprintl { 14 | my @list = @_; 15 | foreach my $item (@list) { 16 | print $item, "\n"; 17 | } 18 | } 19 | 20 | 21 | sub vprinti { 22 | my @list = @_; 23 | my $item; 24 | my $line; 25 | foreach $item (@list) { 26 | foreach $line (split ("\n", $item)) { 27 | next unless ($line =~ s/^\s*\|\s?//); 28 | print "$line\n"; 29 | } 30 | } 31 | } 32 | 33 | 1; 34 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/plugins/eperl.pm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | package eperl; 4 | use strict; 5 | use warnings FATAL => qw(all); 6 | 7 | # add plugin below, and check the usege in each package in the directory 8 | use flop; 9 | use pipe; 10 | use retime; 11 | use assert; 12 | use fifo; 13 | use ram; 14 | 15 | sub vprintl { 16 | my @list = @_; 17 | foreach my $item (@list) { 18 | print $item, "\n"; 19 | } 20 | } 21 | 22 | 23 | sub vprinti { 24 | my @list = @_; 25 | my $item; 26 | my $line; 27 | foreach $item (@list) { 28 | foreach $line (split ("\n", $item)) { 29 | next unless ($line =~ s/^\s*\|\s?//); 30 | print "$line\n"; 31 | } 32 | } 33 | } 34 | 1; 35 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/plugins/example: -------------------------------------------------------------------------------- 1 | //=========================================== 2 | // run below command and reopen this file 3 | // perl -Meperl -I ./ ../../tools/bin/eperl -m example 4 | //=========================================== 5 | //: my $rval = "4'd3"; 6 | //: &eperl::flop("-wid 3 -rval \"$rval\""); 7 | 8 | //: &eperl::pipe("-wid 3 -prefix eric -os"); 9 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/plugins/fifo.pm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | package fifo; 4 | use strict; 5 | use warnings FATAL => qw(all); 6 | 7 | use Carp qw(croak); 8 | use Getopt::Long qw(GetOptions); 9 | use Text::ParseWords qw(shellwords); 10 | 11 | use EperlUtil; 12 | 13 | =head1 fifo 14 | 15 | =cut 16 | 17 | use base ("Exporter"); 18 | our @EXPORT = qw(fifo); 19 | 20 | sub fifo { 21 | my $args = shift; 22 | @ARGV = shellwords($args); 23 | 24 | #================================ 25 | # OPTIONS 26 | #================================ 27 | my $module; 28 | my $depth; 29 | my $width; 30 | my $indent= 0; 31 | GetOptions ( 32 | 'module|m=s' => \$module, 33 | 'depth|d=s' => \$depth, 34 | 'width|w=s' => \$width, 35 | 'indent=s' => \$indent, 36 | ) or die "Unrecognized options @ARGV"; 37 | 38 | croak "-module need be defined" unless $module; 39 | croak "-width need be defined" unless $width; 40 | croak "-depth need be defined" unless $depth; 41 | 42 | #================================ 43 | # Variables 44 | #================================ 45 | my $INDENT = " "x$indent; 46 | 47 | #================================ 48 | # Code 49 | #================================ 50 | vprintl "${INDENT}module $module ("; 51 | vprintl "${INDENT});"; 52 | 53 | vprintl "${INDENT}endmodule"; 54 | } 55 | 56 | 1; 57 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/plugins/ram.pm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | package ram; 4 | use strict; 5 | use warnings FATAL => qw(all); 6 | 7 | use Carp qw(croak); 8 | use Getopt::Long qw(GetOptions); 9 | use Text::ParseWords qw(shellwords); 10 | 11 | use EperlUtil; 12 | 13 | =head1 ram 14 | 15 | =cut 16 | 17 | use base ("Exporter"); 18 | our @EXPORT = qw(ram); 19 | 20 | sub ram { 21 | my $args = shift; 22 | @ARGV = shellwords($args); 23 | 24 | #================================ 25 | # OPTIONS 26 | #================================ 27 | my $module; 28 | my $depth; 29 | my $width; 30 | my $indent= 0; 31 | GetOptions ( 32 | 'module|m=s' => \$module, 33 | 'depth|d=s' => \$depth, 34 | 'width|w=s' => \$width, 35 | 'indent=s' => \$indent, 36 | ) or die "Unrecognized options @ARGV"; 37 | 38 | croak "-module need be defined" unless $module; 39 | croak "-width need be defined" unless $width; 40 | croak "-depth need be defined" unless $depth; 41 | 42 | #================================ 43 | # Variables 44 | #================================ 45 | my $INDENT = " "x$indent; 46 | 47 | #================================ 48 | # Code 49 | #================================ 50 | vprintl "${INDENT}module $module ("; 51 | vprintl "${INDENT});"; 52 | 53 | vprintl "${INDENT}endmodule"; 54 | } 55 | 56 | 1; 57 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/pre_vcp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | ## 4 | ## vcpp vcp pre 5 | ## 6 | use strict; 7 | use warnings; 8 | use Getopt::Long; 9 | 10 | my $ifile; 11 | GetOptions ( 12 | "help|h" => sub {usage(); exit 0}, 13 | "i=s" => \$ifile, 14 | ) or die "Unrecognized options @ARGV"; 15 | 16 | open my $IFH,"<",$ifile or die "Can not open $ifile $!"; 17 | 18 | while (my $line = <$IFH>) { 19 | $line =~ s/'/_&qt&_/g; 20 | $line =~ s/^\s*##/_&pdpd&_/g; 21 | $line =~ s/^\s*\/\//_&slsl&_/g; 22 | if ($line =~ /^\s*#\s*(define|undef|if|ifdef|ifndef|elif|else|endif|error|pragma|include)/) { 23 | # keep there 24 | } else { 25 | $line =~ s/#/_&pd&_/g; 26 | } 27 | print $line; 28 | } 29 | 30 | close $IFH; 31 | 32 | 1; 33 | -------------------------------------------------------------------------------- /scripts/utils/hdl_pp/vcp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | ## 4 | ## vcp - v-h preprocessor 5 | ## 6 | use strict; 7 | use warnings; 8 | use Getopt::Long; 9 | use FindBin qw($Bin); 10 | 11 | my $file_in; 12 | my $file_out; 13 | my $verbose=1; 14 | my $imacros; 15 | my @includes; 16 | my $cpp = "cpp"; 17 | my $outdir="outdir"; 18 | GetOptions ( 19 | "help|h" => sub {usage(); exit 0}, 20 | "imacros=s" => \$imacros, 21 | "o=s" => \$file_out, 22 | "i=s" => \$file_in, 23 | "inc=s" => \@includes, 24 | "cpp=s" => \$cpp, 25 | "verbose" => \$verbose, 26 | ) or die "Unrecognized options @ARGV"; 27 | 28 | print STDERR "Processing $file_in into $file_out\n" if ($verbose) ; 29 | 30 | my $opt_inc = " "; 31 | foreach my $i (@includes) { 32 | $opt_inc .= " -I $i"; 33 | } 34 | 35 | my $command = "$Bin/pre_vcp -i $file_in | $cpp -w -undef -nostdinc -P -C -imacros $imacros $opt_inc |"; 36 | 37 | my $INFILE; 38 | die "Unable to process pipe $command" if (!open( $INFILE, "$command" )) ; 39 | 40 | open my $ofile_fh,">",$file_out or die "Can not open $file_out $!"; 41 | 42 | while (my $line = <$INFILE>) { 43 | $line =~ s/_&qt&_/'/g; 44 | $line =~ s/_&pdpd&_/##/g; 45 | $line =~ s/_&pd&_/#/g; 46 | $line =~ s(_&slsl&_)(//)g; 47 | print $ofile_fh $line; 48 | } 49 | close $ofile_fh; 50 | 51 | print STDERR "$file_out successfully written\n" if ($verbose) ; 52 | 53 | ## 54 | ## usage - show usage 55 | ## 56 | 57 | sub usage() 58 | { 59 | print 60 | "Usage: vcp [-o ] [-imacros ] \n", 61 | "-v = verbose\n", 62 | "-imacros = force #include of before all else\n", 63 | "default output file is .v\n"; 64 | } 65 | -------------------------------------------------------------------------------- /setup_tools.ksh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # TOOLSPATH is supposed to contain the path to your tools 3 | if [ ! -z $TOOLPATH ]; then 4 | export XILINX_VIVADO=$TOOLPATH/tools/xilinx/<20xx.x.x/Vivado/20xx.x 5 | export CDS_LEVEL=XX.YY.ZZZ 6 | export CDS_INST_DIR=$TOOLPATH/tools/cds/Xcelium/${CDS_LEVEL} 7 | else 8 | export XILINX_VIVADO=/tools/Xilinx/Vivado/20XX.Y 9 | export CDS_INST_DIR=/tools/cadence/installs/XCELIUMXXXX.YYY 10 | fi 11 | 12 | export XILINXD_LICENSE_FILE=2100@ 13 | 14 | export CDS_LIC_FILE=@ 15 | 16 | export PATH=${CDS_INST_DIR}/tools/bin/64bit:${CDS_INST_DIR}/tools/bin:${XILINX_VIVADO}/bin:$PATH 17 | 18 | export UVM_HOME=$CDS_INST_DIR/tools/methodology/UVM/CDNS-X.ZY/ 19 | 20 | # Please don't commit the IES_LIBS settings if you set it to your own directory ... 21 | # Set IES_LIBS manually every time you source setup.ksh ... 22 | unset IES_LIBS 23 | echo "Set up completed." 24 | 25 | if [ -z $IES_LIBS ]; then 26 | echo "Please set IES_LIBS to the ies lib path by the following command:" 27 | echo "export IES_LIBS=" 28 | fi 29 | -------------------------------------------------------------------------------- /snap_path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Copyright 2019 International Business Machines 4 | ## 5 | ## Licensed under the Apache License, Version 2.0 (the "License"); 6 | ## you may not use this file except in compliance with the License. 7 | ## You may obtain a copy of the License at 8 | ## 9 | ## http://www.apache.org/licenses/LICENSE-2.0 10 | ## 11 | ## Unless required by applicable law or agreed to in writing, software 12 | ## distributed under the License is distributed on an "AS IS" BASIS, 13 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | ## See the License for the specific language governing permissions and 15 | ## limitations under the License. 16 | ## 17 | 18 | # This script needs to get sourced in order to effectively change $PATH 19 | export SNAP_ROOT=$(dirname $(readlink -f "$BASH_SOURCE")) 20 | [ -f "${SNAP_ROOT}/snap_env.sh" ] && . ${SNAP_ROOT}/snap_env.sh 21 | export PATH=$PATH:$SNAP_ROOT/software/tools 22 | [ -n "$ACTION_ROOT" ] && export PATH=$PATH:$ACTION_ROOT/sw 23 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP_ROOT/software/lib 24 | -------------------------------------------------------------------------------- /software/README.md: -------------------------------------------------------------------------------- 1 | # OC-Accel software 2 | 3 | Set of tools and library intended for simulation and driving OpenCAPI Cards. 4 | 5 | Check for more information. 6 | -------------------------------------------------------------------------------- /software/tools/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenCAPI/oc-accel/5cc3702e40dfe1f21c2e9daf4a7563dbea24c34e/software/tools/.gitignore -------------------------------------------------------------------------------- /software/tools/cfg_snap_actions.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | print << 'EOF'; 4 | /* 5 | * Copyright 2017 International Business Machines 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #ifndef __SNAP_ACTIONS_H__ 21 | #define __SNAP_ACTIONS_H__ 22 | 23 | #include 24 | 25 | struct actions_tab { 26 | const char *vendor; 27 | uint32_t dev1; 28 | uint32_t dev2; 29 | const char *description; 30 | }; 31 | 32 | static const struct actions_tab snap_actions[] = { 33 | EOF 34 | 35 | sub trim($) { 36 | my $l = shift; 37 | $l =~ s/^\s+|\s+$//g; 38 | return $l; 39 | } 40 | 41 | sub hexlify($) { 42 | my $n = shift; 43 | $n =~ s/\.//g; 44 | return $n; 45 | } 46 | 47 | my $num = 0; 48 | 49 | # Processing code goes here 50 | LINE: while (<>) { 51 | chomp(); 52 | @data = split(/\|/, $_); 53 | 54 | next LINE if (scalar(@data) != 4); 55 | 56 | $num += 1; 57 | next LINE if ($num <= 2); 58 | 59 | ($vendor, $dev1, $dev2, $descr) = map {trim($_)} @data; 60 | printf(" { \"%s\", 0x%s, 0x%s, \"%s\" },\n", 61 | $vendor, hexlify($dev1), hexlify($dev2), $descr); 62 | } 63 | 64 | print << 'EOF'; 65 | }; 66 | 67 | #endif /* __SNAP_ACTIONS_H__ */ 68 | EOF 69 | -------------------------------------------------------------------------------- /software/tools/cfg_snap_actions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | ############################################################################ 4 | ## 5 | ## Copyright 2017 International Business Machines 6 | ## 7 | ## Licensed under the Apache License, Version 2.0 (the "License"); 8 | ## you may not use this file except in compliance with the License. 9 | ## You may obtain a copy of the License at 10 | ## 11 | ## http://www.apache.org/licenses/LICENSE#2.0 12 | ## 13 | ## Unless required by applicable law or agreed to in writing, software 14 | ## distributed under the License is distributed on an "AS IS" BASIS, 15 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ## See the License for the specific language governing permissions AND 17 | ## limitations under the License. 18 | ## 19 | ############################################################################ 20 | ############################################################################ 21 | # 22 | 23 | snapdir=$(dirname $(dirname $(dirname $(readlink -f "$BASH_SOURCE")))) # SNAP root directory 24 | ACTION_TYPES_FILE=$snapdir/ActionTypes.md 25 | SNAP_ACTIONS_H=$snapdir/software/tools/snap_actions.h 26 | SNAP_ACTIONS_TMP=$SNAP_ACTIONS_H.tmp 27 | 28 | grep '\(|[ ^I]*\([0-9A-Fa-f]\{2\}\.\)\{3\}[0-9A-Fa-f]\{2\}[ ^I]*\)\{2\}|' $ACTION_TYPES_FILE | sed 's/\(.*\)[ ^I]|[ ^I]\([0-9A-Fa-f]\{2\}\)\.\([0-9A-Fa-f]\{2\}\)\.\([0-9A-Fa-f]\{2\}\)\.\([0-9A-Fa-f]\{2\}\)[ ^I]|[ ^I]\([0-9A-Fa-f]\{2\}\.[0-9A-Fa-f]\{2\}\.[0-9A-Fa-f]\{2\}\.[0-9A-Fa-f]\{2\}\)[ ^I]|[ ^I]\(.*\)/ \{\"\1\"\, 0x\2\3\4\5\, 0x\6\, \"\7\"\},/' | sed 's/\(.* 0x[0-9A-Fa-f]\{8\}\, 0x\)\([0-9A-Fa-f]\{2\}\)\.\([0-9A-Fa-f]\{2\}\)\.\([0-9A-Fa-f]\{2\}\)\.\([0-9A-Fa-f]\{2\}\)\(.*\)/\1\2\3\4\5\6/' | sed '$ s/\"},/\"}/' > $SNAP_ACTIONS_TMP 29 | 30 | sed '/struct[ ^I]actions_tab[ ^I]snap_actions/ r '$SNAP_ACTIONS_TMP <"$SNAP_ACTIONS_H"_template >$SNAP_ACTIONS_H 31 | 32 | rm -f $SNAP_ACTIONS_TMP 33 | -------------------------------------------------------------------------------- /software/tools/force_cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 International Business Machines 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #ifndef __FORCE_CPU_H__ 18 | #define __FORCE_CPU_H__ 19 | 20 | #include 21 | 22 | void print_cpu_mask (void); 23 | int pin_to_cpu (int run_cpu); 24 | int switch_cpu (int cpu, int verbose); 25 | 26 | #endif /* __FORCE_CPU_H__ */ 27 | -------------------------------------------------------------------------------- /software/tools/simple_reg_access.sh: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright 2019 International Business Machines 3 | ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); 5 | ## you may not use this file except in compliance with the License. 6 | ## You may obtain a copy of the License at 7 | ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 9 | ## 10 | ## Unless required by applicable law or agreed to in writing, software 11 | ## distributed under the License is distributed on an "AS IS" BASIS, 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ## See the License for the specific language governing permissions and 14 | ## limitations under the License. 15 | ## 16 | simple_reg_access & 17 | simple_reg_access & 18 | simple_reg_access & 19 | simple_reg_access 20 | -------------------------------------------------------------------------------- /software/tools/soft_reset.sh: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright 2019 International Business Machines 3 | ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); 5 | ## you may not use this file except in compliance with the License. 6 | ## You may obtain a copy of the License at 7 | ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 9 | ## 10 | ## Unless required by applicable law or agreed to in writing, software 11 | ## distributed under the License is distributed on an "AS IS" BASIS, 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | ## See the License for the specific language governing permissions and 14 | ## limitations under the License. 15 | ## 16 | snap_poke 0x00000010 0x00000003 17 | --------------------------------------------------------------------------------