Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROM >= 8k fails to build #232

Open
urish opened this issue Mar 28, 2024 · 3 comments
Open

ROM >= 8k fails to build #232

urish opened this issue Mar 28, 2024 · 3 comments

Comments

@urish
Copy link

urish commented Mar 28, 2024

Describe the bug
A clear and concise description of what the bug is.

Version
1.2.48 (b6a6f12)

To Reproduce
Generate a 8kbyte ROM binary file, e.g.:

dd if=/dev/zero bs=1 count=8192 | tr '\000' 'U' > rom_configs/rom_8k.bin

Use the following configuration:

word_size = 1
check_lvsdrc = True
rom_data = "rom_configs/rom_8k.bin"
data_type = "bin"
output_name = "sky130_rom_8k
output_path = "macro/{output_name}".format(**locals())

import os
exec(open(os.path.join(os.path.dirname(__file__), 'sky130_rom_common.py')).read())

Expected behavior
Should build without any errors

Logs

[openram.router.signal_escape_router/route]: Running signal escape router...
Traceback (most recent call last):
  File "/home/runner/work/sky130-rom-experiments/sky130-rom-experiments/OpenRAM/rom_compiler.py", line 65, in <module>
    r = rom()
  File "/home/runner/work/sky130-rom-experiments/sky130-rom-experiments/OpenRAM/compiler/rom.py", line 54, in __init__
    self.r.create_layout()
  File "/home/runner/work/sky130-rom-experiments/sky130-rom-experiments/OpenRAM/compiler/modules/rom_bank.py", line [86](https://github.com/TinyTapeout/sky130-rom-experiments/actions/runs/8441697713/job/23121431113#step:4:87), in create_layout
    self.route_layout()
  File "/home/runner/work/sky130-rom-experiments/sky130-rom-experiments/OpenRAM/compiler/modules/rom_bank.py", line 124, in route_layout
    self.route_escape_pins(init_bbox)
  File "/home/runner/work/sky130-rom-experiments/sky130-rom-experiments/OpenRAM/compiler/modules/rom_bank.py", line 534, in route_escape_pins
    rtr.route(pins_to_route)
  File "/home/runner/work/sky130-rom-experiments/sky130-rom-experiments/OpenRAM/compiler/router/signal_escape_router.py", line 73, in route
    self.new_pins[source.name] = new_wires[-1]
IndexError: list index out of range
make[1]: *** [Makefile:[90](https://github.com/TinyTapeout/sky130-rom-experiments/actions/runs/8441697713/job/23121431113#step:4:91): sky130_rom_8192.ok] Error 1
make: *** [Makefile:95: sky130_rom_8192] Error 2

(You can see the complete logs here)

Additional context
Also happens on larger sizes (tried 12k, 16k, 24k, 32k), and even with smaller sizes if we increase the value of words_per_row, e.g., for a 128 bytes ROM:

dd if=/dev/zero bs=1 count=128 | tr '\000' 'U' > rom_configs/rom_128.bin
word_size = 1
words_per_row = 32

check_lvsdrc = True

rom_data = "rom_configs/rom_128.bin"
data_type = "bin"

output_name = "rom_128"
output_path = "macro/{output_name}".format(**locals())

import os
exec(open(os.path.join(os.path.dirname(__file__), 'sky130_rom_common.py')).read())
urish added a commit to TinyTapeout/sky130-rom-experiments that referenced this issue Mar 28, 2024
everything >= 8k currently fails (and it also takes a long time to do so)

related issue: VLSIDA/OpenRAM#232
@mguthaus
Copy link
Collaborator

A 1-bit ROM seems very odd and I'm not surprised that doesn't work. Why would you only need 1-bit output?

It would probably be better to have a 8 or even 32-bit output and then select which bit of the output is needed.

@urish
Copy link
Author

urish commented Mar 31, 2024

Thanks for responding! word_size = 1 generates a 8-bit ROM. It's the same word size as defined in the 1K example ROM:

@mguthaus
Copy link
Collaborator

I see. This is actually a mistake as it should be in bits, not bytes like the SRAMs:

self.word_bits = self.word_size * 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants