Closed stefanottili closed 1 year ago
Are you using the current yosys from ORFS? It passes in the nightly CI.
./build_openroad.sh --local --latest installs yosys in 13394216 Jun 23 16:50 tools/install/yosys/bin/yosys
I'm totally unfamiliar with the script/constraint setup for ORFS, where is the clock supposed to come from ?
util/genMassive.py:263: CurAbcClkPeriod = CurAttrs.get('ABC_CP')
util/genMassive.py:370: if CurAbcClkPeriod != 'empty':
util/genMassive.py:371: fo.write('export ABC_CLOCK_PERIOD_IN_PS = %s\n' % CurAbcClkPeriod)
I'm assuming that the 390ns clk_period for asap7/gcd is on the generous side, but that's the not cause of my problem.
diff designs/asap7/gcd/constraint.sdc designs/nangate45/gcd/constraint.sdc
5c5
< set clk_period 390
---
> set clk_period 0.46
10c10
< create_clock -name $clk_name -period $clk_period $clk_port
---
> create_clock -name $clk_name -period $clk_period $clk_port
FYI ASAP7 is in ps so that's 390ps.
@stefanottili Try following command:
make DESIGN_CONFIG=./designs/asap7/gcd/config.mk clean_all
make DESIGN_CONFIG=./designs/asap7/gcd/config.mk
make DESIGN_CONFIG=./designs/asap7/gcd/config.mk clean_all
make DESIGN_CONFIG=./designs/asap7/gcd/config.mk
[INFO][FLOW] Using platform directory ./platforms/asap7
[INFO-FLOW] ASU ASAP7 - version 2
Default PVT selection: BC
mkdir -p ./results/asap7/gcd/base ./logs/asap7/gcd/base ./reports/asap7/gcd/base
(/usr/bin/time /Users/user/OpenROAD-flow-scripts/tools/install/yosys/bin/yosys -v 3 -c ./scripts/synth.tcl) 2>&1 | tee ./logs/asap7/gcd/base/1_1_yosys.log
1. Executing Verilog-2005 frontend: ./designs/src/gcd/gcd.v
2. Executing Liberty frontend.
...
16.16. Finished OPT passes. (There is nothing left to do.)
Using ABC speed script.
[FLOW] Set ABC_CLOCK_PERIOD_IN_PS to:
ERROR: TCL interpreter returned an error: empty expression
in expression ""
1.69 real 1.11 user 0.06 sys
mkdir -p ./results/asap7/gcd/base ./logs/asap7/gcd/base ./reports/asap7/gcd/base
cp results/asap7/gcd/base/1_1_yosys.v results/asap7/gcd/base/1_synth.v
cp: results/asap7/gcd/base/1_1_yosys.v: No such file or directory
@stefanottili
Goto tools/OpenROAD
and share log of ./etc/Env.sh
nangate45, sky130hd, sky130hs designs work, asap7 doesn't ...
Git commit: dc425837eab056835dd63b757e4e587447ac0e43
kernel: Darwin 22.5.0
os: macOS 13.4.1
cmake version 3.26.4
CMake Warning at src/CMakeLists.txt:233 (message):
spdlog: SPDLOG_FMT_EXTERNAL=ON
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- OpenROAD version: v2.0-9151-gdc425837e
-- System name: Darwin
-- Compiler: AppleClang 14.0.3.14030022
-- Build type: RELEASE
-- Install prefix: /usr/local
-- C++ Standard: 17
-- C++ Standard Required: ON
-- C++ Extensions: OFF
-- The C compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python: /opt/homebrew/Frameworks/Python.framework/Versions/3.11/bin/python3.11 (found version "3.11.4") found components: Interpreter
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test C_COMPILER_SUPPORTS__-Wall
-- Performing Test C_COMPILER_SUPPORTS__-Wall - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wall
-- Performing Test CXX_COMPILER_SUPPORTS__-Wall - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-array-bounds
-- Performing Test C_COMPILER_SUPPORTS__-Wno-array-bounds - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-array-bounds
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-array-bounds - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-nonnull
-- Performing Test C_COMPILER_SUPPORTS__-Wno-nonnull - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-nonnull
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-nonnull - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test C_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-maybe-uninitialized - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format-overflow - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format-overflow - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-variable
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-variable - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-variable - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-function
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-function - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-function
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-function - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-write-strings
-- Performing Test C_COMPILER_SUPPORTS__-Wno-write-strings - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-write-strings
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-write-strings - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-sign-compare
-- Performing Test C_COMPILER_SUPPORTS__-Wno-sign-compare - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-sign-compare
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-sign-compare - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-deprecated
-- Performing Test C_COMPILER_SUPPORTS__-Wno-deprecated - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-deprecated
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-deprecated - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test C_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-c++11-narrowing - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register
-- Performing Test C_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-register - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format
-- Performing Test C_COMPILER_SUPPORTS__-Wno-format - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-format - Success
-- Performing Test C_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test C_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-reserved-user-defined-literal - Success
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive
-- Performing Test C_COMPILER_SUPPORTS__-fpermissive - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-fpermissive
-- Performing Test CXX_COMPILER_SUPPORTS__-fpermissive - Success
-- Performing Test C_COMPILER_SUPPORTS__-x
-- Performing Test C_COMPILER_SUPPORTS__-x - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__-x
-- Performing Test CXX_COMPILER_SUPPORTS__-x - Failed
-- Performing Test C_COMPILER_SUPPORTS__c++
-- Performing Test C_COMPILER_SUPPORTS__c++ - Failed
-- Performing Test CXX_COMPILER_SUPPORTS__c++
-- Performing Test CXX_COMPILER_SUPPORTS__c++ - Failed
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test C_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Success
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable
-- Performing Test CXX_COMPILER_SUPPORTS__-Wno-unused-but-set-variable - Success
-- TCL library: /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib
-- TCL header: TCL_HEADER-NOTFOUND
-- Found SWIG: /opt/homebrew/bin/swig (found suitable version "4.1.1", minimum required is "3.0")
-- Using SWIG >= 4.1.1 -flatstaticmethod flag for python
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found version "1.82.0")
-- boost: 1.82.0
-- Found Python3: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 (found version "3.11.4") found components: Development Development.Module Development.Embed
-- Found ZLIB: /opt/homebrew/opt/or-tools/lib/libz.a (found version "1.2.11")
-- spdlog: 1.9.2
-- Found BISON: /opt/homebrew/opt/bison/bin/bison (found version "3.8.2")
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- STA version: 2.4.0
-- STA git sha: 7507ce1c51c76e868dba253d8579e34c7195ca2d
-- System name: Darwin
-- Compiler: AppleClang 14.0.3.14030022
-- Build type: RELEASE
-- Build CXX_FLAGS: -O3 -DNDEBUG
-- Install prefix: /usr/local
-- Found FLEX: /opt/homebrew/opt/flex/bin/flex (found version "2.6.4")
-- TCL library: /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib
-- TCL header: TCL_HEADER-NOTFOUND
-- SSTA: 0
-- STA executable: /Users/stefanthiede/OpenROAD-flow-scripts/tools/OpenROAD/src/sta/app/sta
-- GPU is not enabled
-- TCL library: /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib
-- TCL header: TCL_HEADER-NOTFOUND
-- Found re2: /opt/homebrew/opt/or-tools/lib/cmake/re2/re2Config.cmake (found version "9.0.0")
-- Found Clp: /opt/homebrew/opt/or-tools/lib/cmake/Clp/ClpConfig.cmake (found version "1.17.7")
-- Found Cbc: /opt/homebrew/opt/or-tools/lib/cmake/Cbc/CbcConfig.cmake (found version "2.10.7")
-- Found Eigen3: /opt/homebrew/opt/or-tools/share/eigen3/cmake/Eigen3Config.cmake (found version "3.4.0")
-- Found SCIP: /opt/homebrew/opt/or-tools/lib/cmake/scip/scip-config.cmake (found version "8.0.3")
-- GUI is enabled
-- Charts widget is enabled
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found version "1.82.0") found components: serialization
-- Found OpenMP_CXX: -Xclang -fopenmp (found version "5.0")
-- Found OpenMP: TRUE (found version "5.0")
-- Could NOT find VTune (missing: VTune_LIBRARIES VTune_INCLUDE_DIRS)
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found suitable version "1.82.0", minimum required is "1.78")
-- TCL library: /opt/homebrew/opt/tcl-tk/lib/libtcl8.6.dylib
-- TCL header: TCL_HEADER-NOTFOUND
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found version "1.82.0") found components: serialization system thread
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.82.0/BoostConfig.cmake (found version "1.82.0")
-- Removing MPL2 and PAR to avoid run time fatal error.
-- TCL readline disabled
-- Tcl Extended disabled
-- Python3 enabled
-- Removing PAR_PY to avoid run time fatal error.
-- Configuring done (7.0s)
-- Generating done (0.8s)
-- Build files have been written to: /var/folders/rx/9w9t3wjn4n30b1mtpmngf1_c0000gn/T/tmp.8QW6XMOc
It is passing in the nightly CI for linux https://jenkins.openroad.tools/job/OpenROAD-flow-scripts-Nightly-Public/2744/execution/node/652/log/
We don't officially support mac (due to lack of hw) but many community users use it. It seems like some tcl issue. How did you install your dependencies?
tools/OpenROAD/etc/DependencyInstaller.sh uses homebrew and I wouldn't suspect this because nangate45 and sky130 gcd works just fine.
after removing the flow #'s (because they differ so much) I was able to diff nangate45 vs asap7 gcd 1_1_yosys.log
diff logs/nangate45/gcd/base/1_1_yosys.log logs/asap7/gcd/base/1_1_yosys.log
Why does asap7 use the ABC area script whereas nangate45 uses the speed one ? Why would the speed script fail to set the ABC_CLOCK_PERIOD_IN_PS whereas the other doesn't ?
199,217c208,212
< Using ABC area script.
< [FLOW] Set ABC_CLOCK_PERIOD_IN_PS to: 460
...
> Using ABC speed script.
> [FLOW] Set ABC_CLOCK_PERIOD_IN_PS to:
> ERROR: TCL interpreter returned an error: empty expression
3c3,7
< Executing Verilog-2005 frontend: ./platforms/nangate45/cells_clkgate.v
---
> Executing Liberty frontend.
> Executing Liberty frontend.
> Executing Liberty frontend.
> Executing Liberty frontend.
> Executing Verilog-2005 frontend: ./platforms/asap7/yoSys/cells_clkgate_R.v
168a173
> Executing EXTRACT_FA pass (find and extract full/half adders).
170c175
< Executing Verilog-2005 frontend: ./platforms/nangate45/cells_latch.v
---
> Executing Verilog-2005 frontend: ./platforms/asap7/yoSys/cells_adders_R.v
171a177,188
> Executing TECHMAP pass (map to technology primitives).
> Executing Verilog-2005 frontend: /Users/user/OpenROAD-flow-scripts/tools/install/yosys/bin/../share/yosys/techmap.v
> Continuing TECHMAP pass.
> Executing OPT pass (performing simple optimizations).
> Executing OPT_EXPR pass (perform const folding).
> Executing OPT_MERGE pass (detect identical cells).
> Executing OPT_DFF pass (perform DFF optimizations).
> Executing OPT_CLEAN pass (remove unused cells and wires).
> Finished fast OPT passes.
> Executing TECHMAP pass (map to technology primitives).
> Executing Verilog-2005 frontend: ./platforms/asap7/yoSys/cells_latch_R.v
> Continuing TECHMAP pass.
173,180d189
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFFRS_X1' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFFRS_X2' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFFR_X1' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFFR_X2' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFFS_X1' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFFS_X2' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFF_X1' - skipping.
< Warning: Found unsupported expression 'SE*SI+D*!SE' in pin attribute of cell 'SDFF_X2' - skipping.
199,217c208,212
< Using ABC area script.
< [FLOW] Set ABC_CLOCK_PERIOD_IN_PS to: 460
< Executing ABC pass (technology mapping using ABC).
< Extracting gate netlist of module `\gcd' to `<abc-temp-dir>/input.blif'..
< Executing ABC.
< Re-integrating ABC results.
< Executing SETUNDEF pass (replace undef values with defined constants).
< Executing SPLITNETS pass (splitting up multi-bit signals).
< Executing OPT_CLEAN pass (remove unused cells and wires).
< Executing HILOMAP pass (mapping to constant drivers).
< Executing INSBUF pass (insert buffer cells for connected wires).
< Executing CHECK pass (checking for obvious problems).
< Printing statistics.
< Executing Verilog backend.
< Warnings: 8 unique messages, 72 total
< End of script. Logfile hash: cbf4d8ee81, CPU: user 0.34s system 0.02s
< Yosys 0.13+15 (git sha1 bc027b2ca, gcc 14.0.3 -fPIC -Os)
< Time spent: 37% 2x abc (0 sec), 11% 2x read_liberty (0 sec), ...
< 0.56 real 0.53 user 0.03 sys
---
> Using ABC speed script.
> [FLOW] Set ABC_CLOCK_PERIOD_IN_PS to:
> ERROR: TCL interpreter returned an error: empty expression
> in expression ""
> 1.74 real 1.12 user 0.07 sys
We don't officially support mac (due to lack of hw)
It used to work just fine all of last year. Introducing mpl2 using or-tool static/shared linking the same file broke the build. Disabling of mpl2 doesn’t quite work, the build fails on a test, but it can be manually forced into creating a working openroad binary.
klayout runs ci including macOS.
Since OR promotes the use of AWS, the lack of physical hardware shouldn’t be a showstopper, right ? The guys demonstrating klayout and OR running on AWS at SEMI assured me that they have both x86 and apple silicon for rent.
@stefanottili the ABC period is admittedly extracted using a brittle shell expression: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/69a30ddc0e2da34486d177f89ecf752050dd8ad4/flow/platforms/asap7/config.mk#L60
The expression is slightly different between ASAP7 and other platforms which could be causing the empty expression you see. Can you try evaluating that expression in your shell and seeing what you get?
As a short term workaround, you can simply set ABC_CLOCK_PERIOD_IN_PS
in your config file to match the SDC or even an arbitrary positive number. We don't find that changing this parameter has much effect on the final output.
putting 'export ABC_CLOCK_PERIOD_IN_PS = 390' in line 12 of designs/asap7/gcd/config.mk allows to run asap7/gcd.
There is no "shell" on MacOS with homebrew and the sed command doesn't seem to work either.
Since the scripting works for sky130hs, sky130hd and nangate45, why is the scripting done differently for asap7 ?
There is no "shell" on MacOS with homebrew and the sed command doesn't seem to work either.
Make is supposed to use the shell specified by $SHELL
on your system.
This is the difference between the two platforms:
+export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set\s+clk_period\s+(\S+).*|.*-period\s+(\S+).*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1}')
-export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set clk_period (.+)|.* -period (.+) .*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1*1000}')
I thought the only difference was the *1000
but on closer inspection it seems like the ASAP7 regex uses shorthand characters \s
and \S
for (non-) whitespace characters.
Technically the ASAP7 version is more precise but it looks like your version of sed doesn't support it by default. Can you try these two things and let me know if one of them works?
-r
flag to sed
sed
expression with the one from nangate45. Keep the awk
expression the same.SHELL=/bin/zsh
brew install gnu-sed
and adding PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH" to ~/.zshrc did the trick. I can now run asap7/mock-array with mpl2 since openroad can be built with par/mpl2.
Might be worth adding gnu-sed to the etc/DependencyInstaller.sh for Apple Silicon.
@vvbandeira see note about sed dependency above
openroad compiled with mpl2, gnu-sed allows to run asap7/gcd, trying to run riscv32i errors out with:
OpenROAD v2.0-9070-gbb341ffb9 HierRTLMP Flow enabled... Call Macro Placer -halo_width 3 -report_directory ./objects/asap7/riscv32i/base/rtlmp Error: macro_place.tcl, 141 invalid command name "rtl_macro_placer"
I wonder if you didn't initialize OR with the mpl2 module in your change.
What does "initialize OR with the mpl2 module" mean ? After manually linking both mpl2_test and openroad, I was able to run "make install", what else need to be done ?
I'm able to run asap7/mock-array but not asap7/riskv32i, but then it seems that mock-array manually places the macros.
OpenROAD v2.0-9070-gbb341ffb9 doesn't seem to have a tcl command called 'rtl_macro_placer', at least the code completion in openroad -gui doesn't show one.
OpenRoad::init should call initMacroPlacer2. rtl_macro_placer is defined in src/mpl2/src/mpl.tcl
Removing #ifdef ENABLE_MP2/ENABLE_PAR in OpenROAD.cc, manually linking openroad with ortools.dylib behind libabsl_flags_reflection.a followed by 'make install' got things working.
asap7/riscv32i is running.
Subject
[Design] for example design issues (i.e. the design does not pass functional validation, etc.)
Describe the bug
I can build gcd for sky103hd and nangate45, but asap7 fails in 1_1_yosys Comparing nangate45 log with logs/asap7/gcd/base/1_1_yosys.log shows
nangate45: [FLOW] Set ABC_CLOCK_PERIOD_IN_PS to: 460
asap7: [FLOW] Set ABC_CLOCK_PERIOD_IN_PS to: ERROR: TCL interpreter returned an error: empty expression in expression ""
Expected Behavior
asap7 gcd to run thru
Environment
To Reproduce
cd flow; make
Relevant log output
Screenshots
No response
Additional Context
No response