<@U0175T39732> <@U0169AQ41L6> Is this the latest r...
# openram
m
@Matthew Guthaus @mehdi Is this the latest repo for sky130 sram? https://github.com/VLSIDA/OpenRAM It looks like it is outdated. And I try to build the sky130 sram with https://github.com/VLSIDA/OpenRAM/tree/stable/technology/sky130. But the tech file seems incomplete. I try to use other pdk in public https://github.com/ShonTaware/SRAM_SKY130/tree/main/OpenRAM/sky130A and it can generate some stuff. Which repo should I refer to?
m
Make sure to use the dev branch.
You also need to run "make pdk && make install" to fetch the PDK and install it.
m
Thanks for your guide @Matthew Guthaus ! However, when I try to run some predefined examples in macros folder, it displays some error. I run
make sky130_sram_tiny
, and it displays
Copy code
Building sky130_sram_tiny
docker run -v /home/kevinchen/OpenRAM:/openram \
	-v /sky130A:/sky130A \
	-e PDK_ROOT= \
	-e OPENRAM_HOME=/openram/compiler \
	-e OPENRAM_TECH=/openram/technology \
	-e OPENRAM_TMP=/openram/macros/sky130_sram_tiny/tmp \
	--user 1016:1017 \
	vlsida/openram-ubuntu:latest \
	python3 -u /openram/compiler/openram.py  -v --keeptemp -o sky130_sram_tiny -p /openram/macros/sky130_sram_tiny /openram/macros/configs/sky130_sram_tiny.py && touch sky130_sram_tiny.ok
[globals/init_openram]: Initializing OpenRAM...
[globals/setup_paths]: Temporary files saved in /openram/macros/sky130_sram_tiny/tmp/
[globals/read_config]: Configuration file is /openram/macros/configs/sky130_sram_tiny.py
[globals/read_config]: Output saved in /openram/macros/sky130_sram_tiny/
[globals/import_tech]: Adding technology path: /openram/technology
Traceback (most recent call last):
  File "/openram/compiler/openram.py", line 35, in <module>
    g.init_openram(config_file=args[0], is_unit_test=False)
  File "/openram/compiler/globals.py", line 202, in init_openram
    import_tech()
  File "/openram/compiler/globals.py", line 566, in import_tech
    tech_mod = __import__(OPTS.tech_name)
  File "/openram/technology/sky130/__init__.py", line 32, in <module>
    raise SystemError("Did not find {} under {}".format(sky130_lib_ngspice, open_pdks))
SystemError: Did not find sky130A/libs.tech/ngspice/sky130.lib.spice under sky130A/libs.tech
make[1]: *** [sky130_sram_tiny.ok] Error 1
make: *** [sky130_sram_tiny] Error 2
I look at the missing part and it indeed has those files. Is anything I should also notice when building sky130 examples?
m
Did you set the variable for PDK_ROOT?
m
@Matthew Guthaus Yes I set
PDK_ROOT=$(TOP_DIR)
. But it still displays some module name error.
Copy code
Building sky130_sram_tiny
docker run -v /home/kevinchen/OpenRAM:/openram \
	-v /home/kevinchen/OpenRAM/sky130A:/home/kevinchen/OpenRAM/sky130A \
	-e PDK_ROOT=/home/kevinchen/OpenRAM \
	-e OPENRAM_HOME=/openram/compiler \
	-e OPENRAM_TECH=/openram/technology \
	-e OPENRAM_TMP=/openram/macros/sky130_sram_tiny/tmp \
	--user 1016:1017 \
	vlsida/openram-ubuntu:latest \
	python3 -u /openram/compiler/openram.py  -v --keeptemp -o sky130_sram_tiny -p /openram/macros/sky130_sram_tiny /openram/macros/configs/sky130_sram_tiny.py && touch sky130_sram_tiny.ok
[globals/init_openram]: Initializing OpenRAM...
[globals/setup_paths]: Temporary files saved in /openram/macros/sky130_sram_tiny/tmp/
[globals/read_config]: Configuration file is /openram/macros/configs/sky130_sram_tiny.py
[globals/read_config]: Output saved in /openram/macros/sky130_sram_tiny/
[globals/import_tech]: Adding technology path: /openram/technology
Traceback (most recent call last):
  File "/openram/compiler/openram.py", line 35, in <module>
    g.init_openram(config_file=args[0], is_unit_test=False)
  File "/openram/compiler/globals.py", line 202, in init_openram
    import_tech()
  File "/openram/compiler/globals.py", line 576, in import_tech
    import tech
  File "/openram/technology/sky130/tech/__init__.py", line 12, in <module>
    from .tech import *
  File "/openram/technology/sky130/tech/tech.py", line 119, in <module>
    cell_properties.col_cap_1port_bitcell = cell(['br', 'vdd', 'gnd', 'bl', 'gate'],
NameError: name 'cell' is not defined
make[1]: *** [sky130_sram_tiny.ok] Error 1
make: *** [sky130_sram_tiny] Error 2
m
Oh, this is a bug I just fixed. Hold on.
👍 1
Pull the most recent dev
m
@Matthew Guthaus I can create some stuff but stuck at magic. Here is the log.
Copy code
[globals/init_openram]: Initializing OpenRAM...
[globals/setup_paths]: Temporary files saved in /openram/macros/sky130_sram_tiny/tmp/
[globals/read_config]: Configuration file is /openram/macros/configs/sky130_sram_tiny.py
[globals/read_config]: Output saved in /openram/macros/sky130_sram_tiny/
[globals/import_tech]: Adding technology path: /openram/technology
[globals/init_paths]: Creating temp directory: /openram/macros/sky130_sram_tiny/tmp/
[globals/setup_bitcell]: Using bitcell: bitcell_2port
[characterizer/<module>]: Initializing characterizer...
[characterizer/<module>]: Analytical model enabled.
[verify/<module>]: Initializing verify...
[verify/<module>]: Finding DRC/LVS/PEX tools.
[globals/get_tool]: Using DRC: /usr/local/bin/magic
[globals/get_tool]: Using LVS: /usr/local/bin/netgen
[globals/get_tool]: Using PEX: /usr/local/bin/magic
[globals/setup_bitcell]: Using bitcell: bitcell_2port
|==============================================================================|
|=========                      OpenRAM v1.1.18                       =========|
|=========                                                            =========|
|=========               VLSI Design and Automation Lab               =========|
|=========        Computer Science and Engineering Department         =========|
|=========            University of California Santa Cruz             =========|
|=========                                                            =========|
|=========          Usage help: <mailto:openram-user-group@ucsc.edu|openram-user-group@ucsc.edu>           =========|
|=========        Development help: <mailto:openram-dev-group@ucsc.edu|openram-dev-group@ucsc.edu>        =========|
|=========      Temp dir: /openram/macros/sky130_sram_tiny/tmp/       =========|
|=========                See LICENSE for license info                =========|
|==============================================================================|
** Start: 05/19/2022 14:54:37
Technology: sky130
Total size: 128 bits
Word size: 8
Words: 16
Banks: 1
Write size: 2
RW ports: 1
R-only ports: 1
W-only ports: 0
DRC/LVS/PEX is only run on the top-level design to save run-time (inline_lvsdrc=True to do inline checking).
Characterization is disabled (using analytical delay models) (analytical_delay=False to simulate).
Only generating nominal corner timing.
[sram_config/recompute_sizes]: Recomputing with words per row: 1
[sram_config/recompute_sizes]: Rows: 16 Cols: 8
[sram_config/recompute_sizes]: Row addr size: 4 Col addr size: 0 Bank addr size: 4
[sram_config/compute_sizes]: Set SRAM Words Per Row=1
Words per row: 1
Output files are: 
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.lvs
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.sp
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.v
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.lib
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.py
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.html
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.log
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.lef
/openram/macros/sky130_sram_tiny/sky130_sram_tiny.gds
[bitcell_base_array/__init__]: Creating sky130_sram_tiny_replica_bitcell_array 16 x 8
[dff_array/__init__]: Creating sky130_sram_tiny_data_dff rows=1 cols=8
[dff_array/__init__]: Creating sky130_sram_tiny_wmask_dff rows=1 cols=4
[control_logic/__init__]: Creating control_logic_rw
[dff_buf/__init__]: Creating sky130_sram_tiny_dff_buf
[dff_buf_array/__init__]: Creating sky130_sram_tiny_dff_buf_array
[dff_buf/__init__]: Creating sky130_sram_tiny_dff_buf_0
[pand2/__init__]: Creating pand2 pand2_0
[pdriver/__init__]: creating pdriver pdriver_0
[pbuf/__init__]: creating pbuf with size of 8
[pdriver/__init__]: creating pdriver pdriver_1
[pdriver/__init__]: creating pdriver pdriver_2
[pand3/__init__]: Creating pand3 pand3
[pdriver/__init__]: creating pdriver pdriver_3
[pand3/__init__]: Creating pand3 pand3_0
[pdriver/__init__]: creating pdriver pdriver_4
[pdriver/__init__]: creating pdriver pdriver_5
[delay_chain/__init__]: creating delay chain [4, 4, 4, 4, 4, 4, 4, 4, 4]
[control_logic/__init__]: Creating control_logic_r
[dff_buf_array/__init__]: Creating sky130_sram_tiny_dff_buf_array_0
[pdriver/__init__]: creating pdriver pdriver_6
** Submodules: 0.9 seconds
** Placement: 0.0 seconds
[router_tech/__init__]: Minimum track width: 0.680
[router_tech/__init__]: Minimum track space: 0.300
[router_tech/__init__]: Minimum track wire width: 0.380
[hierarchy_layout/get_bbox]: Size: 213.96 x 149.49 with perimeter margin 0.6799999999999999
[hierarchy_layout/get_bbox]: Size: 213.96 x 149.49 with perimeter margin 7.4799999999999995
[router_tech/__init__]: Minimum track width: 0.680
[router_tech/__init__]: Minimum track space: 0.300
[router_tech/__init__]: Minimum track wire width: 0.380
[grid/__init__]: BBOX coords: ll=v[-48.94,-31.93] ur=v[179.98,132.52]
[grid/__init__]: BBOX grids: ll=v3d[-72, -47, 0.0] ur=v3d[265, 195, 0.0]
**** Retrieving pins: 0.0 seconds
**** Analyzing pins: 0.0 seconds
[router/find_blockages]: Finding blockages.
**** Finding blockages: 0.4 seconds
[router/convert_blockages]: Converting blockages.
**** Converting blockages: 0.1 seconds
**** Converting pins: 0.1 seconds
**** Separating adjacent pins: 0.0 seconds
*** Finding pins and blockages: 3.9 seconds
[signal_escape_router/route_signal]: Escape routing csb1 with scale 5
[signal_escape_router/route_signal]: Escape routing csb0 with scale 5
[signal_escape_router/route_signal]: Escape routing web0 with scale 5
[signal_escape_router/route_signal]: Escape routing din0[0] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[1] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[2] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[3] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[4] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[5] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[6] with scale 5
[signal_escape_router/route_signal]: Escape routing din0[7] with scale 5
[signal_escape_router/route_signal]: Escape routing wmask0[0] with scale 5
[signal_escape_router/route_signal]: Escape routing wmask0[1] with scale 5
[signal_escape_router/route_signal]: Escape routing wmask0[2] with scale 5
[signal_escape_router/route_signal]: Escape routing wmask0[3] with scale 5
[signal_escape_router/route_signal]: Escape routing clk0 with scale 5
[signal_escape_router/route_signal]: Escape routing clk1 with scale 5
[signal_escape_router/route_signal]: Escape routing addr0[3] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[0] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[1] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[2] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[3] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[4] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[5] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[6] with scale 5
[signal_escape_router/route_signal]: Escape routing dout1[7] with scale 5
[signal_escape_router/route_signal]: Escape routing addr1[0] with scale 5
[signal_escape_router/route_signal]: Escape routing addr1[1] with scale 5
[signal_escape_router/route_signal]: Escape routing addr1[2] with scale 5
[signal_escape_router/route_signal]: Escape routing addr1[3] with scale 5
[signal_escape_router/route_signal]: Escape routing addr0[2] with scale 5
[signal_escape_router/route_signal]: Escape routing addr0[0] with scale 5
[signal_escape_router/route_signal]: Escape routing addr0[1] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[0] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[1] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[2] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[3] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[4] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[5] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[6] with scale 5
[signal_escape_router/route_signal]: Escape routing dout0[7] with scale 5
*** Maze routing pins: 37.8 seconds
[router_tech/__init__]: Minimum track width: 0.680
[router_tech/__init__]: Minimum track space: 0.300
[router_tech/__init__]: Minimum track wire width: 0.380
[supply_tree_router/route]: Running supply router on vdd and gnd...
[grid/__init__]: BBOX coords: ll=v[-42.14,-25.13] ur=v[173.18,125.72000000000001]
[grid/__init__]: BBOX grids: ll=v3d[-62, -37, 0.0] ur=v3d[255, 185, 0.0]
**** Retrieving pins: 0.0 seconds
**** Analyzing pins: 0.1 seconds
[router/find_blockages]: Finding blockages.
**** Finding blockages: 1.2 seconds
[router/convert_blockages]: Converting blockages.
**** Converting blockages: 0.1 seconds
**** Converting pins: 1.4 seconds
**** Separating adjacent pins: 2.1 seconds
*** Finding pins and blockages: 8.3 seconds
[grid/__init__]: BBOX coords: ll=v[-45.75,-28.75] ur=v[176.99,129.39000000000001]
[grid/__init__]: BBOX grids: ll=v3d[-67, -42, 0.0] ur=v3d[260, 190, 0.0]
[grid/__init__]: BBOX coords: ll=v[-49.15,-32.15] ur=v[180.39000000000001,132.79]
[grid/__init__]: BBOX grids: ll=v3d[-72, -47, 0.0] ur=v3d[265, 195, 0.0]
[supply_tree_router/route_pins]: Routing vdd with 144 pins.
[supply_tree_router/route_pins]: 0 supply segments routed, 143 remaining.
[supply_tree_router/route_pins]: 25 supply segments routed, 118 remaining.
[supply_tree_router/route_pins]: 50 supply segments routed, 93 remaining.
[supply_tree_router/route_pins]: 75 supply segments routed, 68 remaining.
[supply_tree_router/route_pins]: 100 supply segments routed, 43 remaining.
[supply_tree_router/route_pins]: 125 supply segments routed, 18 remaining.
[supply_tree_router/route_pins]: Routing gnd with 50 pins.
[supply_tree_router/route_pins]: 0 supply segments routed, 49 remaining.
[supply_tree_router/route_pins]: 25 supply segments routed, 24 remaining.
*** Maze routing supplies: 86.7 seconds
** Routing: 161.5 seconds
ERROR: file magic.py: line 236: Unable to find the total error line in Magic output.
Most of the output files are missing. It only shows some incomplete gds file.
I am thinking using docker image. But when I
make mount
in docker folder. It displays name is not found.
Copy code
[kevinchen@instance-627class macros]$ make mount
docker run -it -v /home/kevinchen/OpenRAM:/openram \
	-v /home/kevinchen/OpenRAM/sky130A:/home/kevinchen/OpenRAM/sky130A \
	-e PDK_ROOT=/home/kevinchen/OpenRAM \
	-e OPENRAM_HOME=/openram/compiler \
	-e OPENRAM_TECH=/openram/technology \
	--user 1016:1017 \
	vlsida/openram-ubuntu:latest
groups: cannot find name for group ID 1017
m
what is your host OS?
It looks like it can't figure out your user and group
so that it gets permissions right in the shared mountpoint where it puts the results
m
@Matthew Guthaus I am using CentOS7. But I install docker in my machine. It looks like it is using ubuntu image. Should it be the problem?
m
Yes our image is Ubuntu based. CentOS should have uid/gid stuff. Or do you use something different for authentication on your CentOS machine?
What are your uid and gid? id -u id -g
m
my uid and gid is 1016 and 1017. I check this by
id kevinchen
and it displays
Copy code
uid=1016(kevinchen) gid=1017(kevinchen) groups=1017(kevinchen),4(adm),39(video),1000(google-sudoers),995(docker)
But I can use docker interactive mode like this in another project.
Copy code
docker run \
--network host -it --rm \
-e PDK_ROOT=/shared/OpenLane/pdks \
-v /home/$USER/OpenFASOC/:/shared/OpenFASOC/ \
-v /home/$USER/OpenLane/:/shared/OpenLane/ \
-w /shared/OpenFASOC/openfasoc/generators/test-gen \
efabless/openlane:current
Does that mean I need to add -w configuration in the makefile?
m
That project doesn't set the uid/gid. What happen swhen you run id -u and id -g?
m
It displays 1016 and 1017
m
Well, you are getting an issue with our docker setup...
"groups: cannot find name for group ID 1017"
m
Will it work if I try another OS like Mac?
Or you mean I miss something in the docker setup.
m
I'm not sure right now... we need to isolate.
m
Thanks @Matthew Guthaus! I can make mount successfully with group name found by modifying
make mount
with
Copy code
docker run -it -v $(TOP_DIR):/openram \
		-v $(SKY130_PDK):$(SKY130_PDK) \
		-e PDK_ROOT=$(PDK_ROOT) \
		-e OPENRAM_HOME=/openram/compiler \
		-e OPENRAM_TECH=/openram/technology \
		--user $(UID):$(GID) \
		-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \
		vlsida/openram-ubuntu:latest
But it still stuck at magic after maze routing like previous log even I can make mount successfully, so I guess it is related to other issue. Here is the error log.
Copy code
[supply_tree_router/route_pins]: Routing vdd with 144 pins.
[supply_tree_router/route_pins]: 0 supply segments routed, 143 remaining.
[supply_tree_router/route_pins]: 25 supply segments routed, 118 remaining.
[supply_tree_router/route_pins]: 50 supply segments routed, 93 remaining.
[supply_tree_router/route_pins]: 75 supply segments routed, 68 remaining.
[supply_tree_router/route_pins]: 100 supply segments routed, 43 remaining.
[supply_tree_router/route_pins]: 125 supply segments routed, 18 remaining.
[supply_tree_router/route_pins]: Routing gnd with 50 pins.
[supply_tree_router/route_pins]: 0 supply segments routed, 49 remaining.
[supply_tree_router/route_pins]: 25 supply segments routed, 24 remaining.
*** Maze routing supplies: 87.4 seconds
** Routing: 161.7 seconds
ERROR: file magic.py: line 236: Unable to find the total error line in Magic output.
Traceback (most recent call last):
  File "/openram/compiler/openram.py", line 77, in <module>
    s = sram(name=OPTS.output_name,
  File "/openram/compiler/sram/sram.py", line 50, in __init__
    self.s.create_layout()
  File "/openram/compiler/sram/sram_base.py", line 231, in create_layout
    self.DRC_LVS(final_verification=OPTS.route_supplies, force_check=OPTS.check_lvsdrc)
  File "/openram/compiler/base/hierarchy_design.py", line 70, in DRC_LVS
    self.drc_errors = verify.run_drc(self.cell_name, tempgds, tempspice, extract=True, final_verification=final_verification)
  File "/openram/compiler/verify/magic.py", line 236, in run_drc
    debug.error("Unable to find the total error line in Magic output.", 1)
  File "/openram/compiler/debug.py", line 47, in error
    assert return_value == 0
AssertionError
make[1]: *** [sky130_sram_tiny.ok] Error 1
make: *** [sky130_sram_tiny] Error 2
m
It's not stuck, it cannot find the file output.
This is a file permissions problem
m
So is it related to the uid/gid docker stuff? Does that affect the permission? Should I modify the makefile to obtain the enough authorization?
m
I think it is related... But I'm not certain
m
@Matthew Guthaus Thanks! I will try to run the ubuntu environment and see if it has any problem. Can you help me or generate the 8k byte sram like this https://github.com/efabless/sky130_sram_macros?
Here is the spec:
Copy code
word_size = 32 # Bits
num_words = 2048
human_byte_size = "{:.0f}kbytes".format((word_size * num_words)/1024/8)

# Allow byte writes
write_size = 8 # Bits

# Single port
num_rw_ports = 1
num_r_ports = 0
num_w_ports = 0
ports_human = '1rw'
m
I'm still debugging an issue with single port lvs that cropped up with newer versions of magic/nether
Also 8k is pretty big, we've focused on 1-4 so it might need more verification
m
@Matthew Guthaus I see. Is there newer version of 4k bytes sram? Can you point me to the latest repo or help me generate that?
m
There is not yet. We just pushed the updates and are generating soon.
m
@Matthew Guthaus I just found some clues in the output log
sky130_sram_tiny.drc.err
. I think it might because the magic version is not outdated in the docker image.
Copy code
Error:  Magic version 8.3.277 is required by this techfile, but this version of magic is 8.3.211.
👍 1
I think it would cause the python script cannot get the exact magic output.
m
You are using a newer version of the PDK then. You didn't install it with my makefile? I think that has a commit built in.
Doh, it's using master. I'll have to fix that.
1
They change too often and I can't keep up...
1