diff --git a/etc/clang_plugin/plugin_ASTAnalyzer.cpp b/etc/clang_plugin/plugin_ASTAnalyzer.cpp index 237a4b263..0d6d5e78f 100644 --- a/etc/clang_plugin/plugin_ASTAnalyzer.cpp +++ b/etc/clang_plugin/plugin_ASTAnalyzer.cpp @@ -892,6 +892,7 @@ class DataflowHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParse if(!hasModule) { ReportError(FD->getLocation(), "Dataflow function has no valid submodule"); + return; } } } @@ -932,6 +933,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(bus_size < 32 || bus_size > 1024 || (bus_size & (bus_size - 1)) != 0) { ReportError(attr.first.loc, "Invalid cache bus size"); + continue; } } else if(iequals(attr.first.id, "ways")) @@ -939,6 +941,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(std::stoi(attr.second) <= 0) { ReportError(attr.first.loc, "Invalid cache way count"); + continue; } } else if(iequals(attr.first.id, "line_count")) @@ -946,6 +949,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(std::stoi(attr.second) <= 0) { ReportError(attr.first.loc, "Invalid cache line count"); + continue; } } else if(iequals(attr.first.id, "line_size")) @@ -953,6 +957,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(std::stoi(attr.second) <= 0) { ReportError(attr.first.loc, "Invalid cache line size"); + continue; } } else if(iequals(attr.first.id, "num_write_outstanding")) @@ -960,6 +965,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(std::stoi(attr.second) <= 0) { ReportError(attr.first.loc, "Invalid number of outstanding write operations"); + continue; } } else if(iequals(attr.first.id, "rep_policy")) @@ -967,6 +973,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(attr.second != "lru" && attr.second != "tree") { ReportError(attr.first.loc, "Invalid cache replacement policy"); + continue; } } else if(iequals(attr.first.id, "write_policy")) @@ -974,6 +981,7 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(attr.second != "wb" && attr.second != "wt") { ReportError(attr.first.loc, "Invalid cache write policy"); + continue; } } else @@ -991,10 +999,12 @@ class CacheHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaParser if(iface.find(key_loc_t("cache_line_count", SourceLocation())) == iface.end()) { ReportError(p.loc, "Missing cache line count attribute"); + return; } if(iface.find(key_loc_t("cache_line_size", SourceLocation())) == iface.end()) { ReportError(p.loc, "Missing cache line size attribute"); + return; } } @@ -1008,6 +1018,8 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars SourceManager& _SM; int _parseAction; + static const std::map _ifMapper; + const NamedDecl* getBaseTypeDecl(const QualType& qt) const { const clang::Type* ty = qt.getTypePtr(); @@ -1192,6 +1204,7 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars if(isUnsupportedInterface(FD)) { ReportError(p.loc, "HLS pragma not supported on variadic function declarations"); + return; } auto portName = p.attrs.find(key_loc_t("port", SourceLocation())); if(portName == p.attrs.end()) @@ -1258,6 +1271,15 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars const auto argType = parmDecl->getType(); auto& ifaceMode = bundle_attrs.insert(*ifaceModeReq).first->second; + if(_ifMapper.find(ifaceMode) != _ifMapper.end()) + { + ifaceMode = _ifMapper.at(ifaceMode); + if(ifaceMode.empty()) + { + ReportError(ifaceModeReq->first.loc, "Interface mode not supported."); + return; + } + } auto& parmTypename = parm_attrs[key_loc_t("typename", SourceLocation())]; auto& parmSizeInBytes = parm_attrs[key_loc_t("size_in_bytes", SourceLocation())]; auto& parmOriginalTypename = parm_attrs[key_loc_t("original_typename", SourceLocation())]; @@ -1324,6 +1346,7 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars ifaceMode != "m_axi" && ifaceMode != "axis") { ReportError(ifaceModeReq->first.loc, "Invalid HLS interface mode"); + return; } } } @@ -1353,6 +1376,7 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars (is_channel_if && ifaceMode != "fifo" && ifaceMode != "axis")) { ReportError(ifaceModeReq->first.loc, "Invalid HLS interface mode"); + return; } } else @@ -1373,6 +1397,7 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars ifaceMode != "ovalid" && ifaceMode != "acknowledge") { ReportError(ifaceModeReq->first.loc, "Invalid HLS interface mode"); + return; } if((argType->isBuiltinType() || argType->isEnumeralType()) && ifaceMode == "none") { @@ -1388,6 +1413,7 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars if(ifaceMode == "array" && parm_attrs.find(key_loc_t("elem_count", SourceLocation())) == parm_attrs.end()) { ReportError(ifaceModeReq->first.loc, "HLS interface array element count missing"); + return; } parmTypename = removeSpaces(parmTypename); @@ -1503,6 +1529,9 @@ class InterfaceHLSPragmaHandler : public HLSPragmaAnalyzer, public HLSPragmaPars } static const char* PragmaKeyword; }; +const std::map InterfaceHLSPragmaHandler::_ifMapper = { + {"ap_fifo", "fifo"}, {"ap_none", "none"}, {"ap_vld", "valid"}, {"ap_ovld", "ovalid"}, + {"ap_ack", "acknowledge"}, {"ap_hs", "handshake"}, {"ap_memory", "array"}, {"bram", ""}}; const char* InterfaceHLSPragmaHandler::PragmaKeyword = "interface"; class HLSASTConsumer : public ASTConsumer diff --git a/etc/lib/technology/NC_MEM_IPs.xml b/etc/lib/technology/NC_MEM_IPs.xml index 38e72cbaf..1fb917181 100644 --- a/etc/lib/technology/NC_MEM_IPs.xml +++ b/etc/lib/technology/NC_MEM_IPs.xml @@ -3058,12 +3058,16 @@ function [n_byte_on_databus*2-1:0] CONV; input [n_byte_on_databus*2-1:0] po2; begin case (po2) - 1:CONV=(1<<1)-1; - 2:CONV=(1<<2)-1; - 4:CONV=(1<<4)-1; - 8:CONV=(1<<8)-1; - 16:CONV=(1<<16)-1; - 32:CONV=(1<<32)-1; + 1:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<1)-1; + 2:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<2)-1; + 4:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<4)-1; + 8:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<8)-1; + 16:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<16)-1; + 32:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<32)-1; + 64:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<64)-1; + 128:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<128)-1; + 256:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<256)-1; + 512:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<512)-1; default:CONV=-1; endcase end @@ -3719,12 +3723,16 @@ function [n_byte_on_databus*max_n_writes-1:0] CONV; input [n_byte_on_databus*max_n_writes-1:0] po2; begin case (po2) - 1:CONV=(1<<1)-1; - 2:CONV=(1<<2)-1; - 4:CONV=(1<<4)-1; - 8:CONV=(1<<8)-1; - 16:CONV=(1<<16)-1; - 32:CONV=(1<<32)-1; + 1:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<1)-1; + 2:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<2)-1; + 4:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<4)-1; + 8:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<8)-1; + 16:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<16)-1; + 32:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<32)-1; + 64:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<64)-1; + 128:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<128)-1; + 256:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<256)-1; + 512:CONV=({{n_byte_on_databus*2-1{1'b0}},1'b1}<<512)-1; default:CONV=-1; endcase end @@ -13405,10 +13413,16 @@ endgenerate"/> wire [(n_byte_on_databus/2)*8-1:0] dina; wire [(n_byte_on_databus/2)*8-1:0] dinb; wire [n_byte_on_databus*8-1:0] din; +wire [n_byte_on_databus/2-1:0] be0; +wire [n_byte_on_databus/2-1:0] be1; +wire [n_byte_on_databus-1:0] beTot; assign dina = din_value_aggregated_swapped[memory_offset+:(n_byte_on_databus/2)*8]; assign dinb = din_value_aggregated_swapped[2*BRAM_BITSIZE+memory_offset+:(n_byte_on_databus/2)*8]; assign din = {dinb,dina}; +assign be0 = be_swapped[n_byte_on_databus_offset+:n_byte_on_databus/2]; +assign be1 = be_swapped[n_byte_on_databus+n_byte_on_databus_offset+:n_byte_on_databus/2]; +assign beTot = {be1,be0}; generate if(n_elements == 1) @@ -13432,7 +13446,7 @@ begin .bram_write(bram_write), .memory_addr_a(memory_addr_a), .din_value_aggregated(din), - .be({be_swapped[n_byte_on_databus+n_byte_on_databus_offset+:n_byte_on_databus/2],be_swapped[n_byte_on_databus_offset+:n_byte_on_databus/2]}), + .be(beTot), .dout_a(dout_a)); end else @@ -13458,8 +13472,8 @@ begin .memory_addr_b(memory_addr_a[2*BITSIZE_memory_addr_a-1:BITSIZE_memory_addr_a]), .din_value_aggregated_a(dina), .din_value_aggregated_b(dinb), - .be_a(be_swapped[n_byte_on_databus_offset+:n_byte_on_databus/2]), - .be_b(be_swapped[n_byte_on_databus+n_byte_on_databus_offset+:n_byte_on_databus/2]), + .be_a(be0), + .be_b(be1), .dout_a(dout_a[BRAM_BITSIZE-1:0]), .dout_b(dout_a[2*BRAM_BITSIZE-1:BRAM_BITSIZE]) ); diff --git a/etc/lib/technology/NC_STD_IPs.xml b/etc/lib/technology/NC_STD_IPs.xml index ce2960970..bbd092093 100644 --- a/etc/lib/technology/NC_STD_IPs.xml +++ b/etc/lib/technology/NC_STD_IPs.xml @@ -3035,8 +3035,7 @@ generate end if(done_port & ~ack_check_next) begin - $display("Acknowledge signal never asserted on interface %0d.", index); - $finish; + $display("WARNING: Acknowledge signal never asserted on interface %0d.", index); end end end @@ -6001,4 +6000,4 @@ generate if (VALUE_PARAMETER != 0) assign out1[VALUE_PARAMETER-1:0] = 0; endgene - \ No newline at end of file + diff --git a/etc/libbambu/ac_types/include/ac_channel.h b/etc/libbambu/ac_types/include/ac_channel.h index b7f1472e8..c11f3045c 100644 --- a/etc/libbambu/ac_types/include/ac_channel.h +++ b/etc/libbambu/ac_types/include/ac_channel.h @@ -677,7 +677,8 @@ class ac_channel __FORCE_INLINE bool nb_read(T& t) { bool res; - t = _read(res); + T temp = _read(res); + t = res ? temp : t; return res; } diff --git a/etc/libbambu/libmdpi/include/mdpi/mdpi_driver.h b/etc/libbambu/libmdpi/include/mdpi/mdpi_driver.h index 1faa2f701..9a0143896 100644 --- a/etc/libbambu/libmdpi/include/mdpi/mdpi_driver.h +++ b/etc/libbambu/libmdpi/include/mdpi/mdpi_driver.h @@ -132,8 +132,12 @@ class channel_interface : public interface { if(!_read_size()) { - if_error("Read on empty channel.\n"); - return IF_EMPTY; + if(shift) + { + if_error("Read on empty channel.\n"); + return IF_EMPTY; + } + return 0; } if(shift) { @@ -188,4 +192,4 @@ void __m_interface_channel(uint8_t id, ac_channel& chan, unsigned int max_siz void __m_interface_set(uint8_t id, interface* if_manager); #endif -#endif // __MDPI_DRIVER_H \ No newline at end of file +#endif // __MDPI_DRIVER_H diff --git a/etc/libbambu/libmdpi/mdpi.c b/etc/libbambu/libmdpi/mdpi.c index 8ac20da00..be4c8c2e4 100644 --- a/etc/libbambu/libmdpi/mdpi.c +++ b/etc/libbambu/libmdpi/mdpi.c @@ -149,12 +149,7 @@ int m_read(uint8_t id, svLogicVecVal* data, uint16_t bitsize, ptr_t addr, uint8_ retval = __m_ipc_operation.payload.interface.info; debug("Interface %u read state -> %d.\n", id, retval); - if(retval < 0) - { - error("Read operation error on interface %u: %u.\n", id, retval); - abort(); - } - else if(__m_ipc_operation.payload.interface.id == id) + if(__m_ipc_operation.payload.interface.id == id) { uint16_t i, size = bitsize / 8 + ((bitsize % 8) != 0); #pragma unroll(4) @@ -221,12 +216,7 @@ int m_write(uint8_t id, CONSTARG svLogicVecVal* data, uint16_t bitsize, ptr_t ad retval = __m_ipc_operation.payload.interface.info; debug("Interface %u write state -> %d.\n", id, retval); - if(retval < 0) - { - error("Write operation error on interface %u: %u.\n", id, retval); - abort(); - } - else if(__m_ipc_operation.payload.interface.id == MDPI_IF_IDX_EMPTY) + if(__m_ipc_operation.payload.interface.id == MDPI_IF_IDX_EMPTY) { debug("Fake pipelined write operation on interface %u.\n", id); } diff --git a/etc/libbambu/libmdpi/mdpi_driver.cpp b/etc/libbambu/libmdpi/mdpi_driver.cpp index 7f2ea8d0d..df4960015 100644 --- a/etc/libbambu/libmdpi/mdpi_driver.cpp +++ b/etc/libbambu/libmdpi/mdpi_driver.cpp @@ -406,8 +406,12 @@ class fifo_interface : public interface assert(bitsize == _bitsize && "Bitsize mismatch"); if(_base == _end) { - if_error("Read on empty FIFO.\n"); - return IF_EMPTY; + if(shift) + { + if_error("Read on empty FIFO.\n"); + return IF_EMPTY; + } + return 0; } if(shift) { diff --git a/examples/crypto_designs/multi-keccak/configure.ac b/examples/crypto_designs/multi-keccak/configure.ac index 62593409a..809d1aa84 100644 --- a/examples/crypto_designs/multi-keccak/configure.ac +++ b/examples/crypto_designs/multi-keccak/configure.ac @@ -8,6 +8,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) LT_INIT([disable-shared]) AC_PROG_CC AC_PROG_INSTALL -CFLAGS=' -O3' +CFLAGS=' -O3 --compiler=I386_GCC49' CC=tree-panda-gcc AC_OUTPUT(Makefile include/Makefile src/Makefile src/chi/Makefile src/iota/Makefile src/pi/Makefile src/rho/Makefile src/theta/Makefile) diff --git a/examples/crypto_designs/multi.sh b/examples/crypto_designs/multi.sh index 5fe7444fb..c1cf9ee70 100755 --- a/examples/crypto_designs/multi.sh +++ b/examples/crypto_designs/multi.sh @@ -25,7 +25,7 @@ return_value=$? if test $return_value != 0; then exit $return_value fi -timeout 2h bambu --simulator=MODELSIM --use-raw --top-fname=keccak_coproc --channels-type=MEM_ACC_11 --device-name=LFE335EA8FN484C src/keccak -I./include --simulate --generate-tb=$root_dir/multi-keccak/tb_keccak.c --print-dot "$@" +timeout 2h bambu --simulator=MODELSIM --use-raw --top-fname=keccak_coproc --channels-type=MEM_ACC_11 --compiler=I386_GCC49 --device-name=LFE335EA8FN484C src/keccak -I./include --simulate --generate-tb=$root_dir/multi-keccak/tb_keccak.c --print-dot "$@" return_value=$? if test $return_value != 0; then exit $return_value diff --git a/examples/panda_bench_altera.sh b/examples/panda_bench_altera.sh index fc19ae33f..2300371cc 100755 --- a/examples/panda_bench_altera.sh +++ b/examples/panda_bench_altera.sh @@ -1,6 +1,6 @@ #!/bin/bash script_dir="$(dirname $(readlink -e $0))" -BATCH_ARGS=("--evaluation") +BATCH_ARGS=("--evaluation" "--compiler=I386_GCC49") OUT_SUFFIX="pb_altera" python3 $script_dir/../etc/scripts/test_panda.py --tool=bambu \ diff --git a/examples/panda_bench_hw_list b/examples/panda_bench_hw_list index e555294d5..120f85ac4 100644 --- a/examples/panda_bench_hw_list +++ b/examples/panda_bench_hw_list @@ -1,11 +1,11 @@ --configuration-name=breakout breakout/main.c --top-fname=main --compiler=I386_CLANG11 -Os --device-name=xc7a100t-1csg324-VVD --backend-sdc-extensions=BENCHMARKS_ROOT/breakout/Nexys4_Master.sdc --clock-period=10 breakout/constraints_STD.xml breakout/IPs.xml --C-no-parse=BENCHMARKS_ROOT/breakout/plot.c,BENCHMARKS_ROOT/breakout/sevensegments_ctrl.c,BENCHMARKS_ROOT/breakout/btn_ctrl.c,BENCHMARKS_ROOT/breakout/get_ticks.c --file-input-data=BENCHMARKS_ROOT/breakout/plot.v,BENCHMARKS_ROOT/breakout/sevensegments_ctrl.v,BENCHMARKS_ROOT/breakout/btn_ctrl.v,BENCHMARKS_ROOT/breakout/get_ticks.v --speculative-sdc-scheduling --enable-function-proxy ---configuration-name=led_example led_example/led_example.c --top-fname=led_example -O3 --device-name=xc7a100t-1csg324-VVD --backend-sdc-extensions=BENCHMARKS_ROOT/led_example/Nexys4_Master.sdc --clock-period=10 led_example/constraints_STD.xml led_example/IPs.xml --C-no-parse=BENCHMARKS_ROOT/led_example/sw_ctrl.c,BENCHMARKS_ROOT/led_example/leds_ctrl.c,BENCHMARKS_ROOT/led_example/btn_ctrl.c,BENCHMARKS_ROOT/led_example/sevensegments_ctrl.c --file-input-data=BENCHMARKS_ROOT/led_example/leds_ctrl.v,BENCHMARKS_ROOT/led_example/sw_ctrl.v,BENCHMARKS_ROOT/led_example/btn_ctrl.v,BENCHMARKS_ROOT/led_example/sevensegments_ctrl.v --enable-function-proxy +--configuration-name=led_example led_example/led_example.c --top-fname=led_example -O3 --device-name=xc7a100t-1csg324-VVD --backend-sdc-extensions=BENCHMARKS_ROOT/led_example/Nexys4_Master.sdc --clock-period=10 led_example/constraints_STD.xml led_example/IPs.xml --C-no-parse=BENCHMARKS_ROOT/led_example/sw_ctrl.c,BENCHMARKS_ROOT/led_example/leds_ctrl.c,BENCHMARKS_ROOT/led_example/btn_ctrl.c,BENCHMARKS_ROOT/led_example/sevensegments_ctrl.c --file-input-data=BENCHMARKS_ROOT/led_example/leds_ctrl.v,BENCHMARKS_ROOT/led_example/sw_ctrl.v,BENCHMARKS_ROOT/led_example/btn_ctrl.v,BENCHMARKS_ROOT/led_example/sevensegments_ctrl.v --enable-function-proxy --compiler=I386_GCC49 --configuration-name=pong pong/main.c --top-fname=main --compiler=I386_CLANG11 -Os --device-name=xc7a100t-1csg324-VVD --backend-sdc-extensions=BENCHMARKS_ROOT/pong/Nexys4_Master.sdc --clock-period=10 pong/constraints_STD.xml pong/IPs.xml --C-no-parse=BENCHMARKS_ROOT/pong/plot.c,BENCHMARKS_ROOT/pong/sevensegments_ctrl.c,BENCHMARKS_ROOT/pong/btn_ctrl.c,BENCHMARKS_ROOT/pong/get_ticks.c --file-input-data=BENCHMARKS_ROOT/pong/plot.v,BENCHMARKS_ROOT/pong/sevensegments_ctrl.v,BENCHMARKS_ROOT/pong/btn_ctrl.v,BENCHMARKS_ROOT/pong/get_ticks.v --speculative-sdc-scheduling --enable-function-proxy ---configuration-name=taste taste/InterfaceView.aadl --top-fname=first_function,second_function +--configuration-name=taste taste/InterfaceView.aadl --top-fname=first_function,second_function --compiler=I386_GCC49 ---configuration-name=VGA VGA/delay.c VGA/vgatest.c --top-fname=main --clock-period=20 -O3 --target-file=BENCHMARKS_ROOT/VGA/DE1-characterization-file.xml --backend-script-extensions=BENCHMARKS_ROOT/VGA/DE1_pin_assignments.qsf --backend-sdc-extensions=BENCHMARKS_ROOT/VGA/DE1_design.sdc VGA/constraints_STD.xml VGA/PLOT_IPs.xml --C-no-parse=BENCHMARKS_ROOT/VGA/plot.c,BENCHMARKS_ROOT/VGA/leds_ctrl.c -DC_SIMULATION --file-input-data=BENCHMARKS_ROOT/VGA/leds_ctrl.v,BENCHMARKS_ROOT/VGA/plot.v --enable-function-proxy +--configuration-name=VGA VGA/delay.c VGA/vgatest.c --top-fname=main --clock-period=20 -O3 --target-file=BENCHMARKS_ROOT/VGA/DE1-characterization-file.xml --backend-script-extensions=BENCHMARKS_ROOT/VGA/DE1_pin_assignments.qsf --backend-sdc-extensions=BENCHMARKS_ROOT/VGA/DE1_design.sdc VGA/constraints_STD.xml VGA/PLOT_IPs.xml --C-no-parse=BENCHMARKS_ROOT/VGA/plot.c,BENCHMARKS_ROOT/VGA/leds_ctrl.c -DC_SIMULATION --file-input-data=BENCHMARKS_ROOT/VGA/leds_ctrl.v,BENCHMARKS_ROOT/VGA/plot.v --enable-function-proxy --compiler=I386_GCC49 ---configuration-name=VGA_Nexys4 VGA_Nexys4/vgatest.c --top-fname=main --device-name=xc7a100t-1csg324-VVD --clock-period=10 -O3 --backend-sdc-extensions=BENCHMARKS_ROOT/VGA_Nexys4/Nexys4_Master.sdc VGA_Nexys4/constraints_STD.xml VGA_Nexys4/IPs.xml --C-no-parse=BENCHMARKS_ROOT/VGA_Nexys4/plot.c,BENCHMARKS_ROOT/VGA_Nexys4/leds_ctrl.c,BENCHMARKS_ROOT/VGA_Nexys4/btn_ctrl.c,BENCHMARKS_ROOT/VGA_Nexys4/sw_ctrl.c,BENCHMARKS_ROOT/VGA_Nexys4/delay.c --file-input-data=BENCHMARKS_ROOT/VGA_Nexys4/plot.v,BENCHMARKS_ROOT/VGA_Nexys4/leds_ctrl.v,BENCHMARKS_ROOT/VGA_Nexys4/btn_ctrl.v,BENCHMARKS_ROOT/VGA_Nexys4/sw_ctrl.v,BENCHMARKS_ROOT/VGA_Nexys4/delay.v -fwhole-program --speculative-sdc-scheduling --enable-function-proxy +--configuration-name=VGA_Nexys4 VGA_Nexys4/vgatest.c --top-fname=main --device-name=xc7a100t-1csg324-VVD --clock-period=10 -O3 --backend-sdc-extensions=BENCHMARKS_ROOT/VGA_Nexys4/Nexys4_Master.sdc VGA_Nexys4/constraints_STD.xml VGA_Nexys4/IPs.xml --C-no-parse=BENCHMARKS_ROOT/VGA_Nexys4/plot.c,BENCHMARKS_ROOT/VGA_Nexys4/leds_ctrl.c,BENCHMARKS_ROOT/VGA_Nexys4/btn_ctrl.c,BENCHMARKS_ROOT/VGA_Nexys4/sw_ctrl.c,BENCHMARKS_ROOT/VGA_Nexys4/delay.c --file-input-data=BENCHMARKS_ROOT/VGA_Nexys4/plot.v,BENCHMARKS_ROOT/VGA_Nexys4/leds_ctrl.v,BENCHMARKS_ROOT/VGA_Nexys4/btn_ctrl.v,BENCHMARKS_ROOT/VGA_Nexys4/sw_ctrl.v,BENCHMARKS_ROOT/VGA_Nexys4/delay.v -fwhole-program --speculative-sdc-scheduling --enable-function-proxy --compiler=I386_GCC49 diff --git a/examples/panda_bench_lattice.sh b/examples/panda_bench_lattice.sh index 34b7974e3..47ede1eef 100755 --- a/examples/panda_bench_lattice.sh +++ b/examples/panda_bench_lattice.sh @@ -1,6 +1,6 @@ #!/bin/bash script_dir="$(dirname $(readlink -e $0))" -BATCH_ARGS=("--evaluation=CYCLES") +BATCH_ARGS=("--evaluation=CYCLES" "--compiler=I386_GCC49") OUT_SUFFIX="pb_lattice" python3 $script_dir/../etc/scripts/test_panda.py --tool=bambu \ diff --git a/examples/panda_bench_nanoxplore.sh b/examples/panda_bench_nanoxplore.sh index 452cb5c47..aca0fe13c 100755 --- a/examples/panda_bench_nanoxplore.sh +++ b/examples/panda_bench_nanoxplore.sh @@ -1,6 +1,6 @@ #!/bin/bash script_dir="$(dirname $(readlink -e $0))" -BATCH_ARGS=("--clock-period=20" "--evaluation") +BATCH_ARGS=("--clock-period=20" "--evaluation" "--compiler=I386_GCC49") OUT_SUFFIX="pb_nanoxplore" python3 $script_dir/../etc/scripts/test_panda.py --tool=bambu \ diff --git a/examples/panda_bench_sim.sh b/examples/panda_bench_sim.sh index 78dbffba7..11bb3eeec 100755 --- a/examples/panda_bench_sim.sh +++ b/examples/panda_bench_sim.sh @@ -1,6 +1,6 @@ #!/bin/bash script_dir="$(dirname $(readlink -e $0))" -BATCH_ARGS=("--simulate") +BATCH_ARGS=("--simulate" "--compiler=I386_GCC49") OUT_SUFFIX="pb_sim" python3 $script_dir/../etc/scripts/test_panda.py --tool=bambu \ diff --git a/examples/panda_bench_sim_list b/examples/panda_bench_sim_list index 12851d98e..6bf39d3a5 100644 --- a/examples/panda_bench_sim_list +++ b/examples/panda_bench_sim_list @@ -5,7 +5,7 @@ --configuration-name=file_simulate file_simulate/module.c --top-fname=check_printf --benchmark-name=MEM_ACC_11 --experimental-setup=BAMBU --generate-tb=BENCHMARKS_ROOT/file_simulate/test.xml --file-input-data=BENCHMARKS_ROOT/file_simulate/test.xml --channels-type=MEM_ACC_11 --configuration-name=file_simulate file_simulate/module.c --top-fname=check_printf --benchmark-name=MEM_ACC_NN --experimental-setup=BAMBU --generate-tb=BENCHMARKS_ROOT/file_simulate/test.xml --file-input-data=BENCHMARKS_ROOT/file_simulate/test.xml --channels-type=MEM_ACC_NN -# --configuration-name=parallel_queries parallel_queries/common/atominIncrement.c parallel_queries/common/data.c parallel_queries/trinityq3/lubm_trinityq3.c --top-fname=search --compiler=I386_GCC49 --std=c99 --experimental-setup=BAMBU -O3 -fno-delete-null-pointer-checks -fopenmp --pragma-parse --mem-delay-read=20 --mem-delay-write=20 --channels-type=MEM_ACC_11 --memory-allocation-policy=NO_BRAM --device-name=xc7vx690t-3ffg1930-VVD --clock-period=10 -DMAX_VERTEX_NUMBER=26455 -DMAX_EDGE_NUMBER=100573 -DNDEBUG --benchmark-name=02W-04CH-2C-04CS -DN_THREADS=2 --num-accelerators=2 --memory-banks-number=4 --channels-number=2 --context_switch=4 -IBENCHMARKS_ROOT/parallel_queries/common/ --generate-tb=BENCHMARKS_ROOT/parallel_queries/trinityq3/test-1.xml +# --configuration-name=parallel_queries parallel_queries/common/atominIncrement.c parallel_queries/common/data.c parallel_queries/trinityq3/lubm_trinityq3.c --top-fname=search --std=c99 --experimental-setup=BAMBU -O3 -fno-delete-null-pointer-checks -fopenmp --pragma-parse --mem-delay-read=20 --mem-delay-write=20 --channels-type=MEM_ACC_11 --memory-allocation-policy=NO_BRAM --device-name=xc7vx690t-3ffg1930-VVD --clock-period=10 -DMAX_VERTEX_NUMBER=26455 -DMAX_EDGE_NUMBER=100573 -DNDEBUG --benchmark-name=02W-04CH-2C-04CS -DN_THREADS=2 --num-accelerators=2 --memory-banks-number=4 --channels-number=2 --context_switch=4 -IBENCHMARKS_ROOT/parallel_queries/common/ --generate-tb=BENCHMARKS_ROOT/parallel_queries/trinityq3/test-1.xml --configuration-name=sha256 sha-256/sha-256.c --top-fname=calc_sha_256 --generate-tb=BENCHMARKS_ROOT/sha-256/test.xml --speculative-sdc-scheduling diff --git a/examples/panda_bench_xilinx_ise.sh b/examples/panda_bench_xilinx_ise.sh index 30587b403..66fec77f8 100755 --- a/examples/panda_bench_xilinx_ise.sh +++ b/examples/panda_bench_xilinx_ise.sh @@ -1,6 +1,6 @@ #!/bin/bash script_dir="$(dirname $(readlink -e $0))" -BATCH_ARGS=("--evaluation") +BATCH_ARGS=("--evaluation" "--compiler=I386_GCC49") OUT_SUFFIX="pb_xise" python3 $script_dir/../etc/scripts/test_panda.py --tool=bambu \ diff --git a/examples/panda_bench_xilinx_vvd_list b/examples/panda_bench_xilinx_vvd_list index 36deb23a5..e9d6c6024 100644 --- a/examples/panda_bench_xilinx_vvd_list +++ b/examples/panda_bench_xilinx_vvd_list @@ -1,19 +1,19 @@ ---configuration-name=ads add_device_simple/module.c --top-fname=main --generate-tb=BENCHMARKS_ROOT/add_device_simple/test.xml --simulator=XSIM --experimental-setup=BAMBU -O2 -m64 --pretty-print=a.c --target-file=BENCHMARKS_ROOT/add_device_simple/xc7z045-2ffg900-VVD.xml - ---configuration-name=arf --benchmark-name=arf_simple arf/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf/test.xml - ---configuration-name=ars --benchmark-name=un_zynq arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 ---configuration-name=ars --benchmark-name=un_vx690t arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xc7vx690t,-3,ffg1930,VVD ---configuration-name=ars --benchmark-name=un_vc707 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xc7vx485t,-2,ffg1761,VVD ---configuration-name=ars --benchmark-name=un_artix7 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xc7a100t,-1,csg324,VVD ---configuration-name=ars --benchmark-name=un_kintex arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xcku060,-3,ffva1156,VVD ---configuration-name=ars --benchmark-name=co_zynq arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml ---configuration-name=ars --benchmark-name=co_vx690t arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xc7vx690t,-3,ffg1930,VVD ---configuration-name=ars --benchmark-name=co_vc707 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xc7vx485t,-2,ffg1761,VVD ---configuration-name=ars --benchmark-name=co_artix7 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xc7a100t,-1,csg324,VVD ---configuration-name=ars --benchmark-name=co_kintex arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xcku060,-3,ffva1156,VVD ---configuration-name=ars --benchmark-name=co_alveo280 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xcu280-2Lfsvh2892-VVD ---configuration-name=ars --benchmark-name=co_alveo55c arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xcu55c-2Lfsvh2892-VVD +--configuration-name=ads add_device_simple/module.c --top-fname=main --generate-tb=BENCHMARKS_ROOT/add_device_simple/test.xml --simulator=XSIM --experimental-setup=BAMBU -O2 -m64 --pretty-print=a.c --target-file=BENCHMARKS_ROOT/add_device_simple/xc7z045-2ffg900-VVD.xml --compiler=I386_GCC49 + +--configuration-name=arf --benchmark-name=arf_simple arf/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf/test.xml --compiler=I386_GCC49 + +--configuration-name=ars --benchmark-name=un_zynq arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=un_vx690t arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xc7vx690t,-3,ffg1930,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=un_vc707 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xc7vx485t,-2,ffg1761,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=un_artix7 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xc7a100t,-1,csg324,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=un_kintex arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 --device-name=xcku060,-3,ffva1156,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_zynq arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_vx690t arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xc7vx690t,-3,ffg1930,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_vc707 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xc7vx485t,-2,ffg1761,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_artix7 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xc7a100t,-1,csg324,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_kintex arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xcku060,-3,ffva1156,VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_alveo280 arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xcu280-2Lfsvh2892-VVD --compiler=I386_GCC49 +--configuration-name=ars --benchmark-name=co_alveo55c arf_res_sharing/module.c --top-fname=arf --generate-tb=BENCHMARKS_ROOT/arf_res_sharing/test.xml --simulator=VERILATOR --experimental-setup=BAMBU --generate-interface=WB4 --clock-period=5 --cprf=0.9 --skip-pipe-parameter=1 arf_res_sharing/constraints_STD.xml --device-name=xcu55c-2Lfsvh2892-VVD --compiler=I386_GCC49 --configuration-name=atan --benchmark-name=bit cpp_examples/Xilinx_Examples/Math/atan2_cordic/cordic_atan2.cpp --generate-tb=BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/atan2_cordic/cordic_test.cpp -DTEST_COUNT=200 -DCUSTOM_VERIFICATION --file-input-data=BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/atan2_cordic/input_data.txt,BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/atan2_cordic/ref_results.txt --compiler=I386_CLANG6 --device-name=xc7vx690t-3ffg1930-VVD --clock-period=10 --generate-interface=INFER --top-fname=top_atan2 -DDB_CORDIC -DBIT_ACCURATE --configuration-name=atan --benchmark-name=base cpp_examples/Xilinx_Examples/Math/atan2_cordic/cordic_atan2.cpp --generate-tb=BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/atan2_cordic/cordic_test.cpp -DTEST_COUNT=200 -DCUSTOM_VERIFICATION --file-input-data=BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/atan2_cordic/input_data.txt,BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/atan2_cordic/ref_results.txt --compiler=I386_CLANG6 --device-name=xc7vx690t-3ffg1930-VVD --clock-period=10 --generate-interface=INFER --top-fname=top_atan2 -DDB_CORDIC @@ -25,13 +25,13 @@ --configuration-name=sda --benchmark-name=no-unroll cpp_examples/Xilinx_Examples/Math/squared_difference_accumulate/src/diff_sq_acc.cpp --generate-tb=BENCHMARKS_ROOT/cpp_examples/Xilinx_Examples/Math/squared_difference_accumulate/tb/diff_sq_acc_tb.cpp --compiler=I386_CLANG6 --device-name=xc7vx690t-3ffg1930-VVD --clock-period=10 --generate-interface=INFER --top-fname=diff_sq_acc --configuration-name=gcd --benchmark-name=base cpp_examples/gcd_example/gcd.cc --compiler=I386_GCC7 --generate-tb=BENCHMARKS_ROOT/cpp_examples/gcd_example/test.xml --discrepancy --top-fname=gcd --hls-div=nr1 ---configuration-name=fft --benchmark-name=x_no_main fft_example/fft_float.c --top-fname=FFT --generate-tb=BENCHMARKS_ROOT/fft_example/test_no_main.xml --experimental-setup=BAMBU --device-name=xc7z020,-1,clg484,VVD -lm -Os -ffast-math --libm-std-rounding --generate-interface=WB4 ---configuration-name=fft --benchmark-name=x_main fft_example/fft_float.c --top-fname=main --generate-tb=BENCHMARKS_ROOT/fft_example/test.xml --experimental-setup=BAMBU --device-name=xc7z020,-1,clg484,VVD -lm -Os -ffast-math --libm-std-rounding -fwhole-program +--configuration-name=fft --benchmark-name=x_no_main fft_example/fft_float.c --top-fname=FFT --generate-tb=BENCHMARKS_ROOT/fft_example/test_no_main.xml --experimental-setup=BAMBU --device-name=xc7z020,-1,clg484,VVD -lm -Os -ffast-math --libm-std-rounding --generate-interface=WB4 --compiler=I386_GCC49 +--configuration-name=fft --benchmark-name=x_main fft_example/fft_float.c --top-fname=main --generate-tb=BENCHMARKS_ROOT/fft_example/test.xml --experimental-setup=BAMBU --device-name=xc7z020,-1,clg484,VVD -lm -Os -ffast-math --libm-std-rounding -fwhole-program --compiler=I386_GCC49 ---configuration-name=fortran --benchmark-name=copy fortran/euclid.copy.f -fno-underscoring --top-fname=ngcd --generate-tb=BENCHMARKS_ROOT/fortran/test.copy.xml --speculative-sdc-scheduling --pretty-print=a.c ---configuration-name=fortran --benchmark-name=base fortran/euclid.f -fno-underscoring --top-fname=ngcd --generate-tb=BENCHMARKS_ROOT/fortran/test.xml --speculative-sdc-scheduling --pretty-print=a.c +--configuration-name=fortran --benchmark-name=copy fortran/euclid.copy.f -fno-underscoring --top-fname=ngcd --generate-tb=BENCHMARKS_ROOT/fortran/test.copy.xml --speculative-sdc-scheduling --pretty-print=a.c --compiler=I386_GCC49 +--configuration-name=fortran --benchmark-name=base fortran/euclid.f -fno-underscoring --top-fname=ngcd --generate-tb=BENCHMARKS_ROOT/fortran/test.xml --speculative-sdc-scheduling --pretty-print=a.c --compiler=I386_GCC49 ---configuration-name=funcp function_pointers/qsort/glibc/test.c function_pointers/qsort/glibc/less.c function_pointers/qsort/glibc/qsort.c --generate-tb=BENCHMARKS_ROOT/function_pointers/qsort/tb.c --experimental-setup=BAMBU --device-name=xc7z020-1clg484-VVD -Os --top-fname=test +--configuration-name=funcp function_pointers/qsort/glibc/test.c function_pointers/qsort/glibc/less.c function_pointers/qsort/glibc/qsort.c --generate-tb=BENCHMARKS_ROOT/function_pointers/qsort/tb.c --experimental-setup=BAMBU --device-name=xc7z020-1clg484-VVD -Os --top-fname=test --compiler=I386_GCC49 --configuration-name=IPint IP_integration/top.c --generate-tb=BENCHMARKS_ROOT/IP_integration/main_test.c --experimental-setup=BAMBU --C-no-parse=BENCHMARKS_ROOT/IP_integration/module1.c,BENCHMARKS_ROOT/IP_integration/module2.c,BENCHMARKS_ROOT/IP_integration/printer1.c,BENCHMARKS_ROOT/IP_integration/printer2.c --file-input-data=BENCHMARKS_ROOT/IP_integration/module1.v,BENCHMARKS_ROOT/IP_integration/module2.v,BENCHMARKS_ROOT/IP_integration/printer1.v,BENCHMARKS_ROOT/IP_integration/printer2.v IP_integration/module_lib.xml --top-fname=my_ip IP_integration/constraints_STD.xml --memory-allocation-policy=ALL_BRAM -O3 --enable-function-proxy diff --git a/panda_regressions/hls/Makefile.am b/panda_regressions/hls/Makefile.am index 0f6988a4a..7954f41d7 100644 --- a/panda_regressions/hls/Makefile.am +++ b/panda_regressions/hls/Makefile.am @@ -108,6 +108,8 @@ EXTRA_DIST= \ %D%/bambu_interface_test/simpleif_c1_none.c \ %D%/bambu_interface_test/simpleif_c1_none_test.xml \ %D%/bambu_interface_test/simple_test.c \ + %D%/bambu_interface_test/unused_param.c \ + %D%/bambu_interface_test/unused_param.xml \ %D%/bambu_specific_test5/adders.c \ %D%/bambu_specific_test5/function_call.c \ %D%/bambu_specific_test5/if_clauses.c \ diff --git a/panda_regressions/hls/bambu_interface_test/unused_param.c b/panda_regressions/hls/bambu_interface_test/unused_param.c new file mode 100644 index 000000000..5116b5a3f --- /dev/null +++ b/panda_regressions/hls/bambu_interface_test/unused_param.c @@ -0,0 +1,11 @@ +unsigned long long test(_Bool *a1, _Bool a2[1], _Bool *a3, _Bool *a4, double b, double c) +{ +#pragma HLS interface port = a1 mode = axis +#pragma HLS interface port = a3 mode = fifo +#pragma HLS interface port = a4 mode = m_axi offset = direct bundle = gmem0 + + return b+c; +} + + + diff --git a/panda_regressions/hls/bambu_interface_test/unused_param.xml b/panda_regressions/hls/bambu_interface_test/unused_param.xml new file mode 100644 index 000000000..65365465c --- /dev/null +++ b/panda_regressions/hls/bambu_interface_test/unused_param.xml @@ -0,0 +1,4 @@ + + + + diff --git a/panda_regressions/hls/bambu_interface_test_list b/panda_regressions/hls/bambu_interface_test_list index c620a1857..69ff67290 100644 --- a/panda_regressions/hls/bambu_interface_test_list +++ b/panda_regressions/hls/bambu_interface_test_list @@ -41,6 +41,7 @@ bambu_interface_test/simple_c4_fifo_multiple.c --generate-tb=a="{1,2,3,4,5,6,7,8 bambu_interface_test/simple_c4_fifo.c --generate-tb=a=1,b=2,c=3,d=0 --top-fname=sum3numbers bambu_interface_test/simple_c4_handshake.c --generate-tb=a=1,b=2,c=3,d=0 --top-fname=sum3numbers bambu_interface_test/simple_test.c --generate-tb=a="-7",b="{0}" --top-fname=test +bambu_interface_test/unused_param.c --generate-tb=BENCHMARKS_ROOT/bambu_interface_test/unused_param.xml --top-fname=test bambu_interface_test/simpleif_c1_none.c --generate-tb=BENCHMARKS_ROOT/bambu_interface_test/simpleif_c1_none_test.xml --top-fname=kim --benchmark-name=simpleif_c1_none_xml bambu_interface_test/simpleif_c1_none.c --generate-tb=i1=9,i2=1,i3=5,i4=6,i5=17,i6=19,c1=2,c2=6,c3=13,c4=17,c6=9,COND1=1,COND2=1,o1=0,o2=0 --top-fname=kim --benchmark-name=simpleif_c1_none_no_xml bambu_interface_test/simple_axi_m.c --top-fname=maxNumbers --generate-tb=a="{1,2,3,4,5}",n_ptr="{5}" diff --git a/src/HLS/Makefile.am b/src/HLS/Makefile.am index ea98f72e8..9bd2a0954 100644 --- a/src/HLS/Makefile.am +++ b/src/HLS/Makefile.am @@ -314,6 +314,7 @@ lib_modulebinding_la_CPPFLAGS = \ -I$(top_srcdir)/src/HLS \ -I$(top_srcdir)/src/HLS/function_allocation \ -I$(top_srcdir)/src/HLS/module_allocation \ + -I$(top_srcdir)/src/HLS/module_generator \ -I$(top_srcdir)/src/HLS/virtual_components \ -I$(top_srcdir)/src/HLS/binding \ -I$(top_srcdir)/src/HLS/binding/interconnection \ diff --git a/src/HLS/binding/module/fu_binding.cpp b/src/HLS/binding/module/fu_binding.cpp index 0fe5aa31d..77049eb2b 100644 --- a/src/HLS/binding/module/fu_binding.cpp +++ b/src/HLS/binding/module/fu_binding.cpp @@ -45,6 +45,8 @@ #include "fu_binding.hpp" +#include "ModuleGeneratorManager.hpp" +#include "exceptions.hpp" #include "fu_binding_cs.hpp" #include "funit_obj.hpp" @@ -1110,7 +1112,9 @@ void fu_binding::add_to_SM(const HLS_managerRef HLSMgr, const hlsRef HLS, struct const auto cg_man = HLSMgr->CGetCallGraphManager(); const auto top_function_ids = cg_man->GetRootFunctions(); - if(top_function_ids.find(HLS->functionId) != top_function_ids.end() && cg_man->ExistsAddressedFunction()) + if(top_function_ids.find(HLS->functionId) != top_function_ids.end() && + (cg_man->ExistsAddressedFunction() || + HLSMgr->unused_interfaces.find(HLS->functionId) != HLSMgr->unused_interfaces.end())) { const auto addressed_functions = cg_man->GetAddressedFunctions(); const auto constBitZero = @@ -1187,7 +1191,51 @@ void fu_binding::add_to_SM(const HLS_managerRef HLSMgr, const hlsRef HLS, struct manage_module_ports(HLSMgr, HLS, SM, FU, 0); memory::propagate_memory_parameters(FU, HLS->datapath); } + if(HLSMgr->unused_interfaces.find(HLS->functionId) != HLSMgr->unused_interfaces.end()) + { + const auto HLS_D = HLSMgr->get_HLS_device(); + const auto TechMan = HLS_D->get_technology_manager(); + const auto& res_pair_set = HLSMgr->unused_interfaces.at(HLS->functionId); + for(const auto& [UPlibrary, FUName] : res_pair_set) + { + auto fu_name = FUName; + technology_nodeRef fuObj = TechMan->get_fu(fu_name, UPlibrary); + const auto structManager_obj = GetPointer(fuObj)->CM; + THROW_ASSERT(structManager_obj, "unexpected condition"); + const auto has_to_be_generated = GetPointer(structManager_obj->get_circ())->has_to_be_generated(); + if(has_to_be_generated) + { + INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Unit has to be specialized."); + const ModuleGeneratorManagerRef modGen(new ModuleGeneratorManager(HLSMgr, parameters)); + { + fu_name = fu_name + "_modgen"; + } + const auto& specialized_fuName = fu_name; + + const auto check_lib = TechM->get_library(specialized_fuName); + modGen->create_generic_module(FUName, NULL_VERTEX, FB, UPlibrary, specialized_fuName); + } + const auto FU = SM->add_module_from_technology_library(fu_name + "_i0", fu_name, UPlibrary, circuit, TechM); + if(std::find(memory_modules.begin(), memory_modules.end(), FU) == memory_modules.end()) + { + memory_modules.push_back(FU); + } + INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "---Adding unused interface component: " + FUName); + if(const auto clk_prt = FU->find_member(CLOCK_PORT_NAME, port_o_K, FU)) + { + SM->add_connection(clk_prt, circuit->find_member(CLOCK_PORT_NAME, port_o_K, circuit)); + } + if(const auto reset_prt = FU->find_member(RESET_PORT_NAME, port_o_K, FU)) + { + SM->add_connection(reset_prt, circuit->find_member(RESET_PORT_NAME, port_o_K, circuit)); + } + + manage_module_ports(HLSMgr, HLS, SM, FU, 0); + memory::propagate_memory_parameters(FU, HLS->datapath); + } + } } + if(parameters->IsParameter("chained-memory-modules") && parameters->GetParameter("chained-memory-modules") == 1) { manage_memory_ports_chained(SM, memory_modules, circuit); diff --git a/src/HLS/hls_manager.hpp b/src/HLS/hls_manager.hpp index 852635eed..757c75b25 100644 --- a/src/HLS/hls_manager.hpp +++ b/src/HLS/hls_manager.hpp @@ -184,6 +184,9 @@ class HLS_manager : public application_manager /// information about memory allocation memoryRef Rmem; + /// unused port interface + std::map>> unused_interfaces; + /// information about the simulation SimulationInformationRef RSim; diff --git a/src/HLS/interface/minimal/minimal_interface.cpp b/src/HLS/interface/minimal/minimal_interface.cpp index 5ee1809f8..8826c53bf 100644 --- a/src/HLS/interface/minimal/minimal_interface.cpp +++ b/src/HLS/interface/minimal/minimal_interface.cpp @@ -1057,53 +1057,40 @@ void minimal_interface::build_wrapper(structural_objectRef wrappedObj, structura else { /// check if we have axis master interface - int_port = wrappedObj->find_member("_m_axis_" + port_name + "_TDATA", port_o_K, wrappedObj); - if(int_port) + int_port = wrappedObj->find_member("_" + port_name + "_TDATA", port_o_K, wrappedObj); + if(int_port && + (GetPointer(int_port)->get_port_interface() == port_o::port_interface::PI_FDIN || + GetPointer(int_port)->get_port_interface() == + port_o::port_interface::PI_M_AXIS_TDATA)) { - if(GetPointer(int_port)->get_port_interface() == - port_o::port_interface::PI_FDIN || - GetPointer(int_port)->get_port_interface() == - port_o::port_interface::PI_M_AXIS_TDATA) - { - int_port = wrappedObj->find_member(port_name, port_o_K, wrappedObj); - THROW_ASSERT(int_port, "unexpected condition"); - portsToSkip.insert(int_port); - } + int_port = wrappedObj->find_member(port_name, port_o_K, wrappedObj); + THROW_ASSERT(int_port, "unexpected condition"); + portsToSkip.insert(int_port); } else { /// check if we have axis slave interface - int_port = - wrappedObj->find_member("_s_axis_" + port_name + "_TDATA", port_o_K, wrappedObj); - if(int_port) + int_port = wrappedObj->find_member("_" + port_name + "_TDATA", port_o_K, wrappedObj); + if(int_port && (GetPointer(int_port)->get_port_interface() == + port_o::port_interface::PI_FDOUT || + GetPointer(int_port)->get_port_interface() == + port_o::port_interface::PI_S_AXIS_TDATA)) { - if(GetPointer(int_port)->get_port_interface() == - port_o::port_interface::PI_FDOUT || - GetPointer(int_port)->get_port_interface() == - port_o::port_interface::PI_S_AXIS_TDATA) + portsToSkip.insert(int_port); + if(port_in->get_kind() == port_vector_o_K) { - portsToSkip.insert(int_port); - if(port_in->get_kind() == port_vector_o_K) - { - ext_port = SM_minimal_interface->add_port_vector( - "s_axis_" + port_name + "_TDATA", port_o::IN, - GetPointer(int_port)->get_ports_size(), interfaceObj, - int_port->get_typeRef()); - } - else - { - ext_port = - SM_minimal_interface->add_port("s_axis_" + port_name + "_TDATA", port_o::IN, - interfaceObj, int_port->get_typeRef()); - } - port_o::fix_port_properties(int_port, ext_port); - SM_minimal_interface->add_connection(int_port, ext_port); + ext_port = SM_minimal_interface->add_port_vector( + port_name + "_TDATA", port_o::IN, + GetPointer(int_port)->get_ports_size(), interfaceObj, + int_port->get_typeRef()); } - else if(GetPointer(int_port)->get_port_interface() != - port_o::port_interface::PI_DEFAULT) + else { - THROW_ERROR("not yet supported port interface"); + ext_port = SM_minimal_interface->add_port(port_name + "_TDATA", port_o::IN, + interfaceObj, int_port->get_typeRef()); } + port_o::fix_port_properties(int_port, ext_port); + SM_minimal_interface->add_connection(int_port, ext_port); } } } diff --git a/src/HLS/module_allocation/allocation.cpp b/src/HLS/module_allocation/allocation.cpp index 917e9311d..622b35880 100644 --- a/src/HLS/module_allocation/allocation.cpp +++ b/src/HLS/module_allocation/allocation.cpp @@ -2178,12 +2178,7 @@ DesignFlowStep_Status allocation::InternalExec() std::string specialized_fuName = ""; const auto has_to_be_generated = - structManager_obj && (GetPointer(structManager_obj->get_circ()) - ->get_NP_functionality() - ->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR) || - GetPointer(structManager_obj->get_circ()) - ->get_NP_functionality() - ->exist_NP_functionality(NP_functionality::VHDL_GENERATOR)); + structManager_obj && GetPointer(structManager_obj->get_circ())->has_to_be_generated(); if(has_to_be_generated) { INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Unit has to be specialized."); diff --git a/src/HLS/module_generator/ReadWrite_m_axiModuleGenerator.cpp b/src/HLS/module_generator/ReadWrite_m_axiModuleGenerator.cpp index 822bf8b2c..0e8b88d03 100644 --- a/src/HLS/module_generator/ReadWrite_m_axiModuleGenerator.cpp +++ b/src/HLS/module_generator/ReadWrite_m_axiModuleGenerator.cpp @@ -186,8 +186,12 @@ void ReadWrite_m_axiModuleGenerator::InternalExec(std::ostream& out, structural_ << " BITSIZE_bid=" << _ports_in[i_bid].type_size << ",\n" << " BITSIZE_rid=" << _ports_in[i_rid].type_size << ";\n\n"; - out << "// BITSIZE_log_data_size = log2(BITISZE_in3 >> 3)\n" - << "localparam BITSIZE_log_data_size = " << ceil_log2(_ports_in[i_in3].type_size / 8) << ";\n "; + if(line_count != 0) + { + out << "// BITSIZE_log_data_size = log2(BITISZE_in3 >> 3)\n" + << "localparam BITSIZE_log_data_size = " << ceil_log2(std::max(_ports_in[i_in3].type_size, 8ull) / 8) + << ";\n "; + } /* No cache, build the AXI controller */ std::string ip_components; @@ -465,4 +469,4 @@ void ReadWrite_m_axiModuleGenerator::InternalExec(std::ostream& out, structural_ << "`undef _CACHE_CNT\n"; } structural_manager::add_NP_functionality(mod, NP_functionality::IP_COMPONENT, ip_components); -} \ No newline at end of file +} diff --git a/src/HLS/module_generator/TestbenchAxisModuleGenerator.cpp b/src/HLS/module_generator/TestbenchAxisModuleGenerator.cpp index 75cb935f7..04990db6c 100644 --- a/src/HLS/module_generator/TestbenchAxisModuleGenerator.cpp +++ b/src/HLS/module_generator/TestbenchAxisModuleGenerator.cpp @@ -79,7 +79,7 @@ void TestbenchAxisModuleGenerator::InternalExec(std::ostream& out, structural_ob const auto if_dir = port_o::to_port_direction(iface_attrs.at(FunctionArchitecture::iface_direction)); const auto if_alignment = iface_attrs.at(FunctionArchitecture::iface_alignment); const auto if_ndir = if_dir == port_o::IN ? port_o::OUT : port_o::IN; - const auto port_prefix = (if_dir == port_o::IN ? "s_axis_" : "m_axis_") + arg_name; + const auto port_prefix = arg_name; std::string np_library = mod_cir->get_id() + " index"; std::string ip_components; const auto add_port_parametric = [&](const std::string& suffix, port_o::port_direction dir, unsigned port_size) { diff --git a/src/circuit/structural_objects.cpp b/src/circuit/structural_objects.cpp index 90b5b4710..496d0c093 100644 --- a/src/circuit/structural_objects.cpp +++ b/src/circuit/structural_objects.cpp @@ -3318,6 +3318,12 @@ const NP_functionalityRef& module::get_NP_functionality() const return NP_descriptions; } +bool module::has_to_be_generated() const +{ + return get_NP_functionality()->exist_NP_functionality(NP_functionality::VERILOG_GENERATOR) || + get_NP_functionality()->exist_NP_functionality(NP_functionality::VHDL_GENERATOR); +} + void module::get_NP_library_parameters( structural_objectRef _owner, std::vector>& computed_parameters) const { diff --git a/src/circuit/structural_objects.hpp b/src/circuit/structural_objects.hpp index 302c5636b..3b6107208 100644 --- a/src/circuit/structural_objects.hpp +++ b/src/circuit/structural_objects.hpp @@ -2032,6 +2032,12 @@ class module : public structural_object */ const NP_functionalityRef& get_NP_functionality() const; + /** + * @brief has_to_be_generated + * @return true in case the functionality has to be generated + */ + bool has_to_be_generated() const; + /** * Return the list of object that can be parametrized. * This function is usually used by the backend. diff --git a/src/frontend_analysis/IR_analysis/InterfaceInfer.cpp b/src/frontend_analysis/IR_analysis/InterfaceInfer.cpp index ba868c40b..450e8d367 100644 --- a/src/frontend_analysis/IR_analysis/InterfaceInfer.cpp +++ b/src/frontend_analysis/IR_analysis/InterfaceInfer.cpp @@ -94,7 +94,8 @@ enum class InterfaceInfer::m_axi_type enum class InterfaceInfer::datatype { generic, - ac_type + ac_type, + bool_type }; struct InterfaceInfer::interface_info @@ -130,7 +131,7 @@ struct InterfaceInfer::interface_info void update(const tree_nodeRef& tn, const std::string& _type_name, ParameterConstRef parameters) { - if(type != datatype::ac_type) + if(type != datatype::ac_type && type != datatype::bool_type) { bool is_signed, is_fixed; const auto type_name = @@ -182,6 +183,13 @@ struct InterfaceInfer::interface_info alignment = std::max(alignment, _alignment); } + else if(std::regex_search(_type_name, std::regex("(_B|b)ool[&*]"))) + { + _bitwidth = 1; + type = datatype::bool_type; + alignment = 8; + } + if(_fixed_size && bitwidth && bitwidth != _bitwidth) { THROW_ERROR("Unaligned access not allowed for required interface!"); @@ -611,20 +619,18 @@ DesignFlowStep_Status InterfaceInfer::Exec() const auto arg_ssa_id = AppM->getSSAFromParm(root_id, arg_id); const auto arg_ssa = TM->GetTreeReindex(arg_ssa_id); THROW_ASSERT(GET_CONST_NODE(arg_ssa)->get_kind() == ssa_name_K, ""); + bool unused_port = false; if(GetPointerS(GET_CONST_NODE(arg_ssa))->CGetUseStmts().empty()) { THROW_WARNING("Parameter '" + arg_name + "' not used by any statement"); if(tree_helper::IsPointerType(arg_type)) { - // BEAWARE: none is used here in place of default to avoid memory allocation to consider this as - // an active pointer parameter - interface_type = "none"; + unused_port = true; } else { THROW_ERROR("parameter not used: specified interface does not make sense - " + interface_type); } - continue; } if(tree_helper::IsPointerType(arg_type)) { @@ -640,12 +646,19 @@ DesignFlowStep_Status InterfaceInfer::Exec() if(!isRead && !isWrite) { - if(interface_type == "m_axi" || starts_with(arg_name, "DF_bambu_")) + if(starts_with(arg_name, "DF_bambu_")) { continue; } - THROW_ERROR("Parameter '" + arg_name + "' cannot have interface type '" + interface_type + - "' since no load/store is associated with it"); + if(!unused_port) + { + unused_port = true; + THROW_WARNING("Parameter '" + arg_name + "' not used by any statement"); + } + } + if(unused_port && info.type == datatype::generic) + { + info.bitwidth = 8ULL * std::stoull(parm_attrs.at(FunctionArchitecture::parm_size_in_bytes)); } info.factor = std::max( @@ -752,6 +765,10 @@ DesignFlowStep_Status InterfaceInfer::Exec() return "valid"; } } + else if(unused_port && interface_type == "ptrdefault") + { + return "none"; + } return interface_type; }(); iface_attrs[FunctionArchitecture::iface_bitwidth] = std::to_string(info.bitwidth); @@ -794,7 +811,7 @@ DesignFlowStep_Status InterfaceInfer::Exec() add_to_modified(stmt); store_vdef(stmt); } - create_resource(operationsR, operationsW, info, func_arch); + create_resource(operationsR, operationsW, info, func_arch, unused_port, root_id); } else if(interface_type == "none") { @@ -1708,9 +1725,10 @@ void InterfaceInfer::setWriteInterface(tree_nodeRef stmt, const std::string& arg } void InterfaceInfer::create_resource_Read_simple(const std::set& operations, const interface_info& info, - FunctionArchitectureRef func_arch, bool IO_port) const + FunctionArchitectureRef func_arch, bool IO_port, bool unused_port, + unsigned root_id) const { - if(operations.empty()) + if(operations.empty() && !unused_port) { return; } @@ -1760,7 +1778,7 @@ void InterfaceInfer::create_resource_Read_simple(const std::set& op port_o::port_interface port_if = port_o::port_interface::PI_RNONE; if(if_name == "axis") { - port_data_name = "_s_axis_" + info.arg_id + "_TDATA"; + port_data_name = "_" + info.arg_id + "_TDATA"; port_if = port_o::port_interface::PI_S_AXIS_TDATA; } else if(if_name == "fifo") @@ -1795,11 +1813,9 @@ void InterfaceInfer::create_resource_Read_simple(const std::set& op } if(if_name == "axis") { - const auto inPort_empty_n = - CM->add_port("_s_axis_" + info.arg_id + "_TVALID", port_o::IN, interface_top, bool_type); + const auto inPort_empty_n = CM->add_port("_" + info.arg_id + "_TVALID", port_o::IN, interface_top, bool_type); GetPointerS(inPort_empty_n)->set_port_interface(port_o::port_interface::PI_S_AXIS_TVALID); - const auto inPort_read = - CM->add_port("_s_axis_" + info.arg_id + "_TREADY", port_o::OUT, interface_top, bool_type); + const auto inPort_read = CM->add_port("_" + info.arg_id + "_TREADY", port_o::OUT, interface_top, bool_type); GetPointerS(inPort_read)->set_port_interface(port_o::port_interface::PI_S_AXIS_TREADY); } @@ -1807,6 +1823,10 @@ void InterfaceInfer::create_resource_Read_simple(const std::set& op CM->add_NP_functionality(interface_top, NP_functionality::VERILOG_GENERATOR, "Read_" + if_name + "ModuleGenerator"); TechMan->add_resource(INTERFACE_LIBRARY, ResourceName, CM); + if(unused_port) + { + HLSMgr->unused_interfaces[root_id].insert(std::make_pair(INTERFACE_LIBRARY, ResourceName)); + } for(const auto& fdName : operations) { TechMan->add_operation(INTERFACE_LIBRARY, ResourceName, fdName); @@ -1906,7 +1926,7 @@ void InterfaceInfer::create_resource_Write_simple(const std::set& o port_o::port_interface port_if = port_o::port_interface::PI_WNONE; if(if_name == "axis") { - port_data_name = "_m_axis_" + info.arg_id + "_TDATA"; + port_data_name = "_" + info.arg_id + "_TDATA"; port_if = port_o::port_interface::PI_M_AXIS_TDATA; } else if(if_name == "fifo") @@ -1941,11 +1961,9 @@ void InterfaceInfer::create_resource_Write_simple(const std::set& o } if(if_name == "axis") { - const auto inPort_full_n = - CM->add_port("_m_axis_" + info.arg_id + "_TREADY", port_o::IN, interface_top, bool_type); + const auto inPort_full_n = CM->add_port("_" + info.arg_id + "_TREADY", port_o::IN, interface_top, bool_type); GetPointerS(inPort_full_n)->set_port_interface(port_o::port_interface::PI_M_AXIS_TREADY); - const auto inPort_read = - CM->add_port("_m_axis_" + info.arg_id + "_TVALID", port_o::OUT, interface_top, bool_type); + const auto inPort_read = CM->add_port("_" + info.arg_id + "_TVALID", port_o::OUT, interface_top, bool_type); GetPointerS(inPort_read)->set_port_interface(port_o::port_interface::PI_M_AXIS_TVALID); } @@ -2000,7 +2018,7 @@ void InterfaceInfer::create_resource_Write_simple(const std::set& o void InterfaceInfer::create_resource_array(const std::set& operationsR, const std::set& operationsW, const interface_info& info, - FunctionArchitectureRef func_arch) const + FunctionArchitectureRef func_arch, bool unused_port, unsigned root_id) const { const auto n_channels = parameters->getOption(OPT_channels_number); const auto isDP = n_channels == 2; @@ -2089,7 +2107,7 @@ void InterfaceInfer::create_resource_array(const std::set& operatio GetPointerS(inPort_we1)->set_port_interface(port_o::port_interface::PI_WRITEENABLE); } } - if(!operationsR.empty()) + if(!operationsR.empty() || unused_port) { const auto inPort_din = CM->add_port("_" + bundle_name + "_q0", port_o::IN, interface_top, dataType); GetPointerS(inPort_din)->set_port_interface(port_o::port_interface::PI_DIN); @@ -2114,6 +2132,10 @@ void InterfaceInfer::create_resource_array(const std::set& operatio CM->add_NP_functionality(interface_top, NP_functionality::VERILOG_GENERATOR, read_write_string + info.name + "ModuleGenerator"); TechMan->add_resource(INTERFACE_LIBRARY, ResourceName, CM); + if(unused_port) + { + HLSMgr->unused_interfaces[root_id].insert(std::make_pair(INTERFACE_LIBRARY, ResourceName)); + } const auto fu = GetPointerS(TechMan->get_fu(ResourceName, INTERFACE_LIBRARY)); fu->area_m = area_info::factory(parameters); fu->area_m->set_area_value(0); @@ -2168,7 +2190,8 @@ void InterfaceInfer::create_resource_array(const std::set& operatio void InterfaceInfer::create_resource_m_axi(const std::set& operationsR, const std::set& operationsW, const interface_info& info, - FunctionArchitectureRef func_arch) const + FunctionArchitectureRef func_arch, bool unused_port, + unsigned int root_id) const { THROW_ASSERT(GetPointer(AppM), ""); const auto HLSMgr = GetPointerS(AppM); @@ -2384,6 +2407,7 @@ void InterfaceInfer::create_resource_m_axi(const std::set& operatio GetPointerS(rready)->set_port_interface(port_o::port_interface::M_AXI_RREADY); bool has_slave = false; + bool has_direct = false; for(auto& p : func_arch->parms) { if(p.second.at(FunctionArchitecture::parm_bundle) == bundle_name) @@ -2395,12 +2419,17 @@ void InterfaceInfer::create_resource_m_axi(const std::set& operatio } else if(parm_offset == "direct") { + has_direct = true; const auto offset_port = CM->add_port("_" + p.first, port_o::IN, interface_top, address_interface_datatype); GetPointerS(offset_port)->set_port_interface(port_o::port_interface::PI_M_AXI_DIRECT); } } } + if(!has_direct) + { + THROW_ERROR("only 'direct' axi interfaces are supported"); + } if(has_slave) { const auto s_awvalid = CM->add_port("_s_axi_AXILiteS_AWVALID", port_o::IN, interface_top, bool_type); @@ -2449,7 +2478,10 @@ void InterfaceInfer::create_resource_m_axi(const std::set& operatio "ReadWrite_" + info.name + "ModuleGenerator"); TechMan->add_resource(INTERFACE_LIBRARY, ResourceName, CM); - + if(unused_port) + { + HLSMgr->unused_interfaces[root_id].insert(std::make_pair(INTERFACE_LIBRARY, ResourceName)); + } const auto fu = GetPointerS(TechMan->get_fu(ResourceName, INTERFACE_LIBRARY)); fu->area_m = area_info::factory(parameters); fu->area_m->set_area_value(0); @@ -2498,23 +2530,24 @@ void InterfaceInfer::create_resource_m_axi(const std::set& operatio } void InterfaceInfer::create_resource(const std::set& operationsR, const std::set& operationsW, - const interface_info& info, FunctionArchitectureRef func_arch) const + const interface_info& info, FunctionArchitectureRef func_arch, bool unused_port, + unsigned root_id) const { if(info.name == "none" || info.name == "acknowledge" || info.name == "valid" || info.name == "ovalid" || info.name == "handshake" || info.name == "fifo" || info.name == "axis") { - THROW_ASSERT(!operationsR.empty() || !operationsW.empty(), "unexpected condition"); + THROW_ASSERT(!operationsR.empty() || !operationsW.empty() || unused_port, "unexpected condition"); const auto IO_P = !operationsR.empty() && !operationsW.empty(); - create_resource_Read_simple(operationsR, info, func_arch, IO_P); + create_resource_Read_simple(operationsR, info, func_arch, IO_P, unused_port, root_id); create_resource_Write_simple(operationsW, info, func_arch, IO_P); } else if(info.name == "array") { - create_resource_array(operationsR, operationsW, info, func_arch); + create_resource_array(operationsR, operationsW, info, func_arch, unused_port, root_id); } else if(info.name == "m_axi") { - create_resource_m_axi(operationsR, operationsW, info, func_arch); + create_resource_m_axi(operationsR, operationsW, info, func_arch, unused_port, root_id); } else { diff --git a/src/frontend_analysis/IR_analysis/InterfaceInfer.hpp b/src/frontend_analysis/IR_analysis/InterfaceInfer.hpp index b1f4ea399..fcbf4fa46 100644 --- a/src/frontend_analysis/IR_analysis/InterfaceInfer.hpp +++ b/src/frontend_analysis/IR_analysis/InterfaceInfer.hpp @@ -94,19 +94,23 @@ class InterfaceInfer : public ApplicationFrontendFlowStep const tree_manipulationRef tree_man, const tree_managerRef TM); void create_resource_Read_simple(const std::set& operations, const interface_info& info, - FunctionArchitectureRef func_arch, bool IO_port) const; + FunctionArchitectureRef func_arch, bool IO_port, bool unused_port, + unsigned int root_id) const; void create_resource_Write_simple(const std::set& operations, const interface_info& info, FunctionArchitectureRef func_arch, bool IO_port) const; void create_resource_array(const std::set& operationsR, const std::set& operationsW, - const interface_info& info, FunctionArchitectureRef func_arch) const; + const interface_info& info, FunctionArchitectureRef func_arch, bool unused_port, + unsigned int root_id) const; void create_resource_m_axi(const std::set& operationsR, const std::set& operationsW, - const interface_info& info, FunctionArchitectureRef func_arch) const; + const interface_info& info, FunctionArchitectureRef func_arch, bool unused_port, + unsigned root_id) const; void create_resource(const std::set& operationsR, const std::set& operationsW, - const interface_info& info, FunctionArchitectureRef func_arch) const; + const interface_info& info, FunctionArchitectureRef func_arch, bool unused_port, + unsigned int root_id) const; public: /** diff --git a/src/wrapper/compiler/compiler_wrapper.cpp b/src/wrapper/compiler/compiler_wrapper.cpp index e7c8120c9..46f84c959 100644 --- a/src/wrapper/compiler/compiler_wrapper.cpp +++ b/src/wrapper/compiler/compiler_wrapper.cpp @@ -2979,7 +2979,9 @@ int CompilerWrapper::getCompatibleCompilers() int CompilerWrapper::getDefaultCompiler() { return -#if HAVE_I386_CLANG7_COMPILER && defined(_WIN32) +#if HAVE_I386_CLANG16_COMPILER + static_cast(CompilerWrapper_CompilerTarget::CT_I386_CLANG16); +#elif HAVE_I386_CLANG7_COMPILER && defined(_WIN32) static_cast(CompilerWrapper_CompilerTarget::CT_I386_CLANG7); #elif HAVE_I386_GCC49_COMPILER static_cast(CompilerWrapper_CompilerTarget::CT_I386_GCC49); @@ -3011,8 +3013,6 @@ int CompilerWrapper::getDefaultCompiler() static_cast(CompilerWrapper_CompilerTarget::CT_I386_CLANG12); #elif HAVE_I386_CLANG13_COMPILER static_cast(CompilerWrapper_CompilerTarget::CT_I386_CLANG13); -#elif HAVE_I386_CLANG16_COMPILER - static_cast(CompilerWrapper_CompilerTarget::CT_I386_CLANG16); #elif HAVE_I386_CLANGVVD_COMPILER static_cast(CompilerWrapper_CompilerTarget::CT_I386_CLANGVVD); #else