diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 375b8dd..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: linux_build - -# Run CI on -# - each push -# - each pull request -# - scheduled weekly -on: - push: - branches-ignore: - - ganesh_dev - pull_request: - schedule: - - cron: '0 0 * * 0 ' # weekly - -# Environment variables -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - MAKEFLAGS: "-j8" - -# Multiple job to tests -jobs: - # Test the compilation compatibility - linux_build: - name: ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} - - # Branch on different OS and settings - strategy: - fail-fast: false - matrix: - config: - - { - name: "Quick Test: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-basic-tests-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8", - reg_script: "quick_test.sh" - } - - # Define the steps to run the build job - steps: - - name: Checkout Skywater-OpenFPGA repo - uses: actions/checkout@v2 - - - name: Checkout OpenFPGA repo - uses: actions/checkout@v2 - with: - repository: lnis-uofu/OpenFPGA - path: OpenFPGA - submodules: true - - - name: Install dependency - run: source ./.github/workflows/install_dependency.sh - - - name: Checkout CMake version - run: cmake --version - - - name: Checkout iVerilog version - run: | - iverilog -V - vvp -V - - - name: Create CMake build environment - # Some projects don't allow in-source building, so create a separate build directory - # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/OpenFPGA/build - - - name: Configure CMake - # Use a bash shell so we can use the same syntax for environment variable - # access regardless of the host operating system - shell: bash - working-directory: ${{runner.workspace}}/OpenFPGA/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. - # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 - run: | - export CC=${{ matrix.config.cc }} - export CXX=${{ matrix.config.cxx }} - cmake $GITHUB_WORKSPACE/OpenFPGA -DCMAKE_BUILD_TYPE=$BUILD_TYPE - - - name: Build - working-directory: ${{runner.workspace}}/OpenFPGA/build - shell: bash - # Execute the build. You can specify a specific target with "--target " - run: | - cmake --build . --config $BUILD_TYPE - - - name: ${{matrix.config.name}} - if: contains(matrix.config.name, 'Quick Test') - shell: bash - # Execute the test. - run: source ./.github/workflows/${{matrix.config.reg_script}} diff --git a/.gitignore b/.gitignore index 171fc07..7150d05 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ **/SDC/**/*.sdc !**/SDC/**/disable_configure_ports.sdc */runOpenFPGA +**/*_task/latest +**/*_task/run** +**/*_task/config/task.conf \ No newline at end of file diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/BENCHMARK b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/BENCHMARK new file mode 120000 index 0000000..9fed94a --- /dev/null +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/BENCHMARK @@ -0,0 +1 @@ +../../BENCHMARK \ No newline at end of file diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/efpga_12x12_sim_openfpga.xml b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/efpga_12x12_sim_openfpga.xml new file mode 100644 index 0000000..92cf793 --- /dev/null +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/efpga_12x12_sim_openfpga.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/openfpga_arch.xml b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/openfpga_arch.xml index ae3eada..b001089 100644 --- a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/openfpga_arch.xml +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/openfpga_arch.xml @@ -217,7 +217,7 @@ - + diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/vpr_arch.xml b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/vpr_arch.xml index 537719b..65eac01 100644 --- a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/vpr_arch.xml +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/arch/vpr_arch.xml @@ -1,5 +1,5 @@ @@ -186,21 +188,6 @@ - - - - + + + + - + - + - + 1 1 1 - + 1 1 1 1 1 - + 1 1 1 1 1 1 1 1 1 @@ -277,18 +255,17 @@ - + - + @@ -296,7 +273,7 @@ - + @@ -306,7 +283,7 @@ - + @@ -386,9 +363,9 @@ - - - + + + @@ -398,22 +375,22 @@ - - + + - - + + - - + + - - + + @@ -443,18 +420,10 @@ - - 235e-12 - 235e-12 - 235e-12 + ${LUT3_DELAY} + ${LUT3_DELAY} + ${LUT3_DELAY} @@ -462,20 +431,22 @@ - - + + + + - - - + + + @@ -505,20 +476,11 @@ - - 261e-12 - 261e-12 - 261e-12 - 261e-12 + ${LUT4_DELAY} + ${LUT4_DELAY} + ${LUT4_DELAY} + ${LUT4_DELAY} @@ -526,20 +488,22 @@ - - + + + + - - - + + + @@ -561,15 +525,27 @@ - - + + - - + + + + + + + + - - + + + + + + + + @@ -591,52 +567,36 @@ I[0] should be connected to in[0] --> - - - - - - - - - - - - - - - - @@ -650,7 +610,7 @@ - + @@ -662,7 +622,7 @@ - + diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/config/task_simulation.conf b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/config/task_simulation.conf index 7f44b87..4ca2f68 100644 --- a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/config/task_simulation.conf +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/config/task_simulation.conf @@ -1,4 +1,4 @@ - # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = +# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # Configuration file for running experiments # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = # timeout_each_job : FPGA Task script splits fpga flow into multiple jobs @@ -8,18 +8,19 @@ [GENERAL] run_engine=openfpga_shell -power_analysis = false +power_tech_file = ${PATH:OPENFPGA_PATH}/openfpga_flow/tech/PTM_45nm/45nm.xml +power_analysis = true spice_output=false verilog_output=true -timeout_each_job = 20*60 -fpga_flow=vpr_blif +timeout_each_job = 1*60 +fpga_flow=yosys_vpr arch_variable_file=${PATH:TASK_DIR}/design_variables.yml [OpenFPGA_SHELL] -openfpga_shell_template=${PATH:TASK_DIR}/generate_fabric.openfpga +openfpga_shell_template=${PATH:TASK_DIR}/generate_testbench.openfpga openfpga_arch_file=${PATH:TASK_DIR}/arch/openfpga_arch.xml -openfpga_sim_setting_file=${PATH:OPENFPGA_PATH}/openfpga_flow/openfpga_simulation_settings/auto_sim_openfpga.xml +openfpga_sim_setting_file=${PATH:TASK_DIR}/arch/efpga_12x12_sim_openfpga.xml external_fabric_key_file=${PATH:TASK_DIR}/arch/fabric_key.xml openfpga_vpr_device_layout=12x12 openfpga_vpr_route_chan_width=40 @@ -28,12 +29,26 @@ openfpga_vpr_route_chan_width=40 arch0=${PATH:TASK_DIR}/arch/vpr_arch.xml [BENCHMARKS] -bench0=${PATH:TASK_DIR}/micro_benchmark/and.blif +bench0=${PATH:TASK_DIR}/BENCHMARK/and2/and2.v +bench1=${PATH:TASK_DIR}/BENCHMARK/and2_latch/and2_latch.v +bench2=${PATH:TASK_DIR}/BENCHMARK/bin2bcd/bin2bcd.v +bench3=${PATH:TASK_DIR}/BENCHMARK/counter/counter.v +bench4=${PATH:TASK_DIR}/BENCHMARK/routing_test/routing_test.v +# RS decoder needs 1.5k LUT4, exceeding device capacity +#bench5=${PATH:TASK_DIR}/BENCHMARK/rs_decoder/rtl/rs_decoder.v +bench6=${PATH:TASK_DIR}/BENCHMARK/simon_bit_serial/rtl/*.v +bench7=${PATH:TASK_DIR}/BENCHMARK/and2_or2/and2_or2.v [SYNTHESIS_PARAM] -bench0_top = top -bench0_act = ${PATH:TASK_DIR}/micro_benchmark/and.act -bench0_verilog = ${PATH:TASK_DIR}/micro_benchmark/and.v +bench0_top = and2 +bench1_top = and2_latch +bench2_top = bin2bcd +bench3_top = counter +bench4_top = routing_test +# RS decoder needs 1.5k LUT4, exceeding device capacity +#bench5_top = rs_decoder_top +bench6_top = top_module +bench7_top = and2_or2 [SCRIPT_PARAM_MIN_ROUTE_CHAN_WIDTH] -vpr_fpga_verilog_formal_verification_top_netlist= +#end_flow_with_test= diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/design_variables.yml b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/design_variables.yml index dc3d2f3..b47dbcd 100644 --- a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/design_variables.yml +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/design_variables.yml @@ -1 +1,26 @@ -DELAY_VALUE: 12 \ No newline at end of file +L1_SB_MUX_DELAY: 1.61e-9 +L2_SB_MUX_DELAY: 1.61e-9 +L4_SB_MUX_DELAY: 1.61e-9 +CB_MUX_DELAY: 1.38e-9 +L1_WIRE_R: 100 +L1_WIRE_C: 1e-12 +L2_WIRE_R: 100 +L2_WIRE_C: 1e-12 +L4_WIRE_R: 100 +L4_WIRE_C: 1e-12 +INPAD_DELAY: 0.11e-9 +OUTPAD_DELAY: 0.11e-9 +FF_T_SETUP: 0.39e-9 +FF_T_CLK2Q: 0.43e-9 +LUT_OUT0_TO_FF_D_DELAY: 1.14e-9 +LUT_OUT1_TO_FF_D_DELAY: 0.56e-9 +LUT_OUT0_TO_FLE_OUT_DELAY: 0.89e-9 +FF0_Q_TO_FLE_OUT_DELAY: 0.88e-9 +LUT_OUT1_TO_FLE_OUT_DELAY: 0.78e-9 +FF1_Q_TO_FLE_OUT_DELAY: 0.89e-9 +LUT3_DELAY: 0.86e-9 +LUT3_OUT_TO_FLE_OUT_DELAY: 1.44e-9 +LUT4_DELAY: 1.14e-9 +LUT4_OUT_TO_FLE_OUT_DELAY: 1.46e-9 +REGIN_TO_FF0_DELAY: 0.58e-9 +FF0_TO_FF1_DELAY: 0.56e-9 diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_fabric.openfpga b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_fabric.openfpga index 4131cae..8e9a0a6 100644 --- a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_fabric.openfpga +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_fabric.openfpga @@ -36,9 +36,19 @@ write_fabric_bitstream --format xml --file fabric_bitstream.xml # Write the Verilog netlist for FPGA fabric # - Enable the use of explicit port mapping in Verilog netlist -write_fabric_verilog --file ./SRC --explicit_port_mapping --include_timing --include_signal_init --support_icarus_simulator --verbose +write_fabric_verilog \ + --file ./SRC \ + --explicit_port_mapping \ + --include_timing \ + --verbose -write_verilog_testbench --file ./SRC --reference_benchmark_file_path ${REFERENCE_VERILOG_TESTBENCH} --print_top_testbench --print_preconfig_top_testbench --print_simulation_ini ./SimulationDeck/simulation_deck.ini --explicit_port_mapping +write_verilog_testbench \ + --file ./SRC \ + --reference_benchmark_file_path ${REFERENCE_VERILOG_TESTBENCH} \ + --print_top_testbench \ + --print_preconfig_top_testbench \ + --print_simulation_ini ./SimulationDeck/simulation_deck.ini \ + --explicit_port_mapping # Write the SDC files for PnR backend # - Turn on every options here diff --git a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_testbench.openfpga b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_testbench.openfpga index 124dbcd..1318a22 100644 --- a/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_testbench.openfpga +++ b/FPGA1212_SOFA_HD_PNR/FPGA1212_SOFA_HD_task/generate_testbench.openfpga @@ -1,6 +1,12 @@ -# Run VPR for the 'and' design +# This script is designed to generate Verilog testbenches +# with a fixed device layout +# It will only output netlists to be used by verification tools +# including +# - Verilog testbenches, used by ModelSim +# - SDC for a mapped FPGA fabric, used by Synopsys PrimeTime +# #--write_rr_graph example_rr_graph.xml -vpr ${VPR_ARCH_FILE} ${VPR_TESTBENCH_BLIF} --clock_modeling route --route_chan_width 200 +vpr ${VPR_ARCH_FILE} ${VPR_TESTBENCH_BLIF} --clock_modeling ideal --device ${OPENFPGA_VPR_DEVICE_LAYOUT} --route_chan_width ${OPENFPGA_VPR_ROUTE_CHAN_WIDTH} --absorb_buffer_luts off # Read OpenFPGA architecture definition read_openfpga_arch -f ${OPENFPGA_ARCH_FILE} @@ -24,11 +30,7 @@ lut_truth_table_fixup # Build the module graph # - Enabled compression on routing architecture modules # - Enable pin duplication on grid modules -build_fabric --compress_routing --duplicate_grid_pin --load_fabric_key ${EXTERNAL_FABRIC_KEY_FILE} - -# Write the fabric hierarchy of module graph to a file -# This is used by hierarchical PnR flows -write_fabric_hierarchy --file ./fabric_hierarchy.txt +build_fabric --compress_routing --duplicate_grid_pin --load_fabric_key ${EXTERNAL_FABRIC_KEY_FILE} #--verbose # Repack the netlist to physical pbs # This must be done before bitstream generator and testbench generation @@ -37,28 +39,29 @@ repack #--verbose # Build the bitstream # - Output the fabric-independent bitstream to a file -build_architecture_bitstream --verbose --write_file fabric_indepenent_bitstream.xml - -build_fabric_bitstream +build_architecture_bitstream --verbose --write_file arch_bitstream.xml # Build fabric-dependent bitstream -build_fabric_bitstream -write_fabric_bitstream --format plain_text --file fabric_bitstream.bit -write_fabric_bitstream --format xml --file fabric_bitstream.xml +build_fabric_bitstream --verbose + +# Write fabric-dependent bitstream +write_fabric_bitstream --file fabric_bitstream.xml --format xml + # Write the Verilog testbench for FPGA fabric # - We suggest the use of same output directory as fabric Verilog netlists # - Must specify the reference benchmark file if you want to output any testbenches # - Enable top-level testbench which is a full verification including programming circuit and core logic of FPGA # - Enable pre-configured top-level testbench which is a fast verification skipping programming phase # - Simulation ini file is optional and is needed only when you need to interface different HDL simulators using openfpga flow-run scripts -write_verilog_testbench --file ./SRC --reference_benchmark_file_path ${REFERENCE_VERILOG_TESTBENCH} --print_top_testbench --print_preconfig_top_testbench --print_simulation_ini ./SimulationDeck/simulation_deck.ini --explicit_port_mapping - -# Write the SDC files for PnR backend -# - Turn on every options here -write_pnr_sdc --file ./SDC - -# Write SDC to disable timing for configure ports -write_sdc_disable_timing_configure_ports --file ./SDC/disable_configure_ports.sdc +write_verilog_testbench --file ./SRC \ + --reference_benchmark_file_path ${REFERENCE_VERILOG_TESTBENCH} \ + --print_top_testbench \ + --print_preconfig_top_testbench \ + --print_simulation_ini ./SimulationDeck/simulation_deck.ini \ + --explicit_port_mapping +# Exclude signal initialization since it does not help simulator converge +# due to the lack of reset pins for flip-flops +#--include_signal_init # Write the SDC to run timing analysis for a mapped FPGA fabric write_analysis_sdc --file ./SDC_analysis @@ -67,4 +70,4 @@ write_analysis_sdc --file ./SDC_analysis exit # Note : -# To run verification at the end of the flow maintain source in ./SRC directory \ No newline at end of file +# To run verification at the end of the flow maintain source in ./SRC directory diff --git a/FPGA1212_SOFA_HD_PNR/Makefile b/FPGA1212_SOFA_HD_PNR/Makefile index d0ddbe8..ee8f2b4 100644 --- a/FPGA1212_SOFA_HD_PNR/Makefile +++ b/FPGA1212_SOFA_HD_PNR/Makefile @@ -6,6 +6,7 @@ PYTHON_EXEC=python3.8 RERUN = 0 TB = top OPTIONS = +TASK_FILENAME ?= task_simulation.conf .SILENT: .ONESHELL: @@ -19,9 +20,10 @@ runOpenFPGA: echo "xxxxxxxx Python version 3.8 is required xxxxxxxx"; exit; fi + echo "Running ${TASK_FILENAME} task" # =================== Clean Previous Run ================================= rm -f $${OPENFPGA_PATH}/openfpga_flow/tasks/$${TASK_DIR_NAME} - (cd ./$${TASK_DIR_NAME}/config && rm -f task.conf && cp task_simulation.conf task.conf) + (cd ./$${TASK_DIR_NAME}/config && rm -f task.conf && ln -s ${TASK_FILENAME} task.conf) # ===================== Generate Netlist ================================= (currDir=$${PWD} && cd $$OPENFPGA_PATH && source openfpga.sh && cd $$currDir && diff --git a/FPGA1212_SOFA_HD_PNR/config.sh b/FPGA1212_SOFA_HD_PNR/config.sh index 160cff3..b9ffd06 100644 --- a/FPGA1212_SOFA_HD_PNR/config.sh +++ b/FPGA1212_SOFA_HD_PNR/config.sh @@ -2,7 +2,7 @@ # = = = = = = = = = = = = = = Variables Sections = = = = = = = = = = = = = = = # = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -export PROJ_NAME=FPGA1212_SOFA_HD_PNR # Project Name +export PROJ_NAME=FPGA1212_SOFA_HD # Project Name export FPGA_SIZE_X=12 # Grid X Size export FPGA_SIZE_Y=12 # Grid Y Size # Design Style [hier/flat], mostly hier