From d70489cbb825fca85751c5f331a5fa1914d91efc Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 2 May 2023 07:58:48 +0200 Subject: [PATCH] update import script to initialize broker --- CMakeLists.txt | 2 +- contrib/.gitignore | 2 ++ contrib/README.md | 62 +++++++++++++++++++++++++++------------ contrib/build.tcl | 2 +- contrib/tgc_import.tcl | 9 +++--- contrib/tgc_import_tb.tcl | 8 ++--- 6 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 contrib/.gitignore diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e59c6d..cf7a3b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,7 @@ if(SystemC_FOUND) string(TOUPPER ${CORE_NAME_LC} CORE_NAME) target_compile_definitions(${PROJECT_NAME} PRIVATE CORE_${CORE_NAME}) endforeach() - target_link_libraries(${PROJECT_NAME} PUBLIC dbt-rise-tgc scc) + target_link_libraries(${PROJECT_NAME} PUBLIC dbt-rise-tgc scc-sysc) if(WITH_LLVM) target_link_libraries(${PROJECT_NAME} PUBLIC ${llvm_libs}) endif() diff --git a/contrib/.gitignore b/contrib/.gitignore new file mode 100644 index 0000000..72f2821 --- /dev/null +++ b/contrib/.gitignore @@ -0,0 +1,2 @@ +/results +/cwr diff --git a/contrib/README.md b/contrib/README.md index ea9a647..c65d9f6 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -1,19 +1,43 @@ - # requires conan version 1.59 - # requires decent cmake version 3.23 for instance - git clone --recursive -b develop https://git.minres.com/TGFS/TGC-ISS.git - cd TGC-ISS/ - setenv COWAREHOME /scratch/rocco/workarea/tools/synopsys/T-2022.06-3 - setenv SNPSLMD_LICENSE_FILE 27001@lic02.arteris.com:5285@lic-node0:5285@lic03:5285@lic-node1 - source $COWAREHOME/SLS/linux/setup.csh pae - setenv SNPS_ENABLE_MEM_ON_DEMAND_IN_GENERIC_MEM 1 - setenv PATH $COWAREHOME/common/bin/:${PATH} - setenv LD_LIBRARY_PATH /scratch/rocco/workarea/tools/gcc-9.3.0-install/lib64/ - setenv CC /scratch/rocco/workarea/tools/synopsys/T-2022.06-3/SLS/linux/common/bin//gcc - setenv CXX /scratch/rocco/workarea/tools/synopsys/T-2022.06-3/SLS/linux/common/bin//g++ - cmake -S . -B build/Debug-PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON -DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=/scratch/rocco/partners/minres/TGC-ISS/install - cd build/Debug-PA/ - make -j 16 install - cd ../../dbt-rise-tgc/contrib - setenv TGFS_INSTALL_ROOT /scratch/rocco/partners/minres/TGC-ISS/install/ - # import the TGC core itself - pct tgc_import.tcl +# Notes + +* requires conan version 1.59 +* requires decent cmake version 3.23 + +Setup for tcsh: + +``` +git clone --recursive -b develop https://git.minres.com/TGFS/TGC-ISS.git +cd TGC-ISS/ +setenv TGFS_INSTALL_ROOT `pwd`/install +setenv COWAREHOME +setenv SNPSLMD_LICENSE_FILE +source $COWAREHOME/SLS/linux/setup.csh pae +setenv SNPS_ENABLE_MEM_ON_DEMAND_IN_GENERIC_MEM 1 +setenv PATH $COWAREHOME/common/bin/:${PATH} +setenv CC $COWAREHOME/SLS/linux/common/bin/gcc +setenv CXX $COWAREHOME/SLS/linux/common/bin/g++ +cmake -S . -B build/PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON \ + -DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=${TGFS_INSTALL_ROOT} +cmake --build build/PA --target install -j16 +cd dbt-rise-tgc/contrib +# import the TGC core itself +pct tgc_import_tb.tcl +``` + +Setup for bash: + +``` +git clone --recursive -b develop https://git.minres.com/TGFS/TGC-ISS.git +cd TGC-ISS/ +export TGFS_INSTALL_ROOT `pwd`/install +module load tools/pa/T-2022.06 +export SNPS_ENABLE_MEM_ON_DEMAND_IN_GENERIC_MEM=1 +export CC=$COWAREHOME/SLS/linux/common/bin/gcc +export CXX=$COWAREHOME/SLS/linux/common/bin/g++ +cmake -S . -B build/PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON \ + -DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=${TGFS_INSTALL_ROOT} +cmake --build build/PA --target install -j16 +cd dbt-rise-tgc/contrib +# import the TGC core itself +pct tgc_import_tb.tcl +``` \ No newline at end of file diff --git a/contrib/build.tcl b/contrib/build.tcl index 023815b..e4da561 100644 --- a/contrib/build.tcl +++ b/contrib/build.tcl @@ -16,7 +16,7 @@ namespace eval Specification { set libdir "${install_dir}/lib64" set preprocessorOptions [concat $preprocessorOptions "-I${incldir}"] # Set the Linker paths. - set linkerOptions [concat $linkerOptions "-Wl,-rpath,${libdir} -L${libdir} -ldbt-rise-tgc_sc"] + set linkerOptions [concat $linkerOptions "-Wl,-rpath,${libdir} -L${libdir} -ldbt-rise-tgc_sc -lscc-sysc"] } default { puts stderr "ERROR: \"$target\" is not supported, [::scsh::version]" diff --git a/contrib/tgc_import.tcl b/contrib/tgc_import.tcl index 549f1b6..99a5026 100644 --- a/contrib/tgc_import.tcl +++ b/contrib/tgc_import.tcl @@ -9,8 +9,8 @@ proc getScriptDirectory {} { set hardware /HARDWARE/HW/HW set scriptDir [getScriptDirectory] -#set top_design_name sysc::tgfs::core_complex set top_design_name core_complex +set encap_name sysc::tgfs::${top_design_name} set clocks clk_i set resets rst_i set model_prefix "i_" @@ -25,7 +25,8 @@ set model_postfix "" ::pct::set_update_existing_encaps_flag true ::pct::set_dynamic_port_arrays_flag true ::pct::set_import_scml_properties_flag true -::pct::load_modules --set-category modules tgc_import.cc +::pct::set_import_encap_prop_as_extra_prop_flag true +::pct::load_modules --set-category modules ${scriptDir}/tgc_import.cc # Set Port Protocols correctly set block ${top_design_name} @@ -39,9 +40,9 @@ foreach reset ${resets} { # Set compile settings and look set block SYSTEM_LIBRARY:${top_design_name} -::pct::set_encap_build_script $block/sysc::tgfs::${top_design_name} $scriptDir/build.tcl +::pct::set_encap_build_script $block/${encap_name} $scriptDir/build.tcl ::pct::set_background_color_rgb $block 255 255 255 255 -::pct::create_instance SYSTEM_LIBRARY:${top_design_name} ${hardware} ${model_prefix}${top_design_name}${model_postfix} sysc::tgfs::${top_design_name} sysc::tgfs::${top_design_name}() +::pct::create_instance SYSTEM_LIBRARY:${top_design_name} ${hardware} ${model_prefix}${top_design_name}${model_postfix} ${encap_name} ${encap_name}() ::pct::set_bounds i_${top_design_name} 200 300 100 400 # export the result as component diff --git a/contrib/tgc_import_tb.tcl b/contrib/tgc_import_tb.tcl index 9df24aa..8d3a899 100644 --- a/contrib/tgc_import_tb.tcl +++ b/contrib/tgc_import_tb.tcl @@ -40,10 +40,10 @@ puts "setting parameters for DBT-RISE-TGC/Bus and memory components" ::pct::set_param_value $hardware/i_core_complex {Scml Properties} elf_file ${FW_name} ::pct::set_address i_core_complex/initiator:i_Memory_Generic/MEM 0x0 -#::pct::set_main_configuration Default {{#include } {::scc::init_logging(::scc::LogConfig().logLevel(::scc::log::INFO).coloredOutput(false).logAsync(false));} {} {} {}} -#::pct::set_main_configuration Debug {{#include } {::scc::init_logging(::scc::LogConfig().logLevel(::scc::log::DEBUG).coloredOutput(false).logAsync(false));} {} {} {}} -#::pct::create_simulation_build_config Debug -#::pct::set_simulation_build_project_setting Debug "Main Configuration" Default +::pct::set_main_configuration Default {{#include } {::scc::init_logging(::scc::LogConfig().logLevel(::scc::log::INFO).coloredOutput(false).logAsync(false));} {} {} {}} +::pct::set_main_configuration Debug {{#include } {::scc::init_logging(::scc::LogConfig().logLevel(::scc::log::DEBUG).coloredOutput(false).logAsync(false));} {} {} {}} +::pct::create_simulation_build_config Debug +::pct::set_simulation_build_project_setting Debug "Main Configuration" Default # add build settings and save design for next steps #::pct::set_simulation_build_project_setting "Debug" "Linker Flags" "-Wl,-z,muldefs $::env(VERILATOR_ROOT)/include/verilated.cpp $::env(VERILATOR_ROOT)/include/verilated_vcd_sc.cpp $::env(VERILATOR_ROOT)/include/verilated_vcd_c.cpp" #::pct::set_simulation_build_project_setting "Debug" "Include Paths" $::env(VERILATOR_ROOT)/include/