Skip to content

Commit

Permalink
use get_mainlib helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
gadfort committed Aug 28, 2024
1 parent 9918c65 commit 2bbb2ec
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 20 deletions.
3 changes: 2 additions & 1 deletion scgallery/designs/aes/aes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand All @@ -35,7 +36,7 @@ def setup(target=asap7_demo):

chip.add('option', 'idir', src_root, package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

if mainlib.startswith('sky130'):
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/ariane/ariane.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import freepdk45_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs import _common
from scgallery import Gallery

Expand All @@ -28,7 +29,7 @@ def setup(target=freepdk45_demo):
for src in ('ariane.sv2v.v', 'macros.v'):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('tool', 'yosys', 'task', 'syn_asic', 'var', 'flatten', 'false')
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/black_parrot/black_parrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import freepdk45_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs import _common
from scgallery import Gallery

Expand All @@ -27,7 +28,7 @@ def setup(target=freepdk45_demo):
for src in ('pickled.v',):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('option', 'define', 'SYNTHESIS')
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/caliptra/datavault.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import freepdk45_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs.caliptra.src import datavault
from scgallery import Gallery

Expand All @@ -28,7 +29,7 @@ def setup(target=freepdk45_demo):

chip.set('option', 'entrypoint', 'dv')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('constraint', 'density', 30)
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/caliptra/keyvault.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import freepdk45_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs.caliptra.src import keyvault
from scgallery import Gallery

Expand All @@ -28,7 +29,7 @@ def setup(target=freepdk45_demo):

chip.set('option', 'entrypoint', 'kv')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('constraint', 'density', 20)
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/caliptra/sha512.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import freepdk45_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs.caliptra.src import sha512
from scgallery import Gallery

Expand All @@ -28,7 +29,7 @@ def setup(target=freepdk45_demo):

chip.set('option', 'entrypoint', 'sha512_ctrl')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('constraint', 'density', 30)
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/dynamic_node/dynamic_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand All @@ -25,7 +26,7 @@ def setup(target=asap7_demo):
chip.input('modules/dynamic_node_2dmesh/NETWORK_2dmesh/dynamic_node_2dmesh.pickle.v',
package='OPDB')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

return chip
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/ethmac/ethmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs import _common
from scgallery import Gallery

Expand Down Expand Up @@ -53,7 +54,7 @@ def setup(target=asap7_demo):
chip.add('option', 'define', 'ETH_VIRTUAL_SILICON_RAM')
chip.input(os.path.join('ethmac', 'extra', 'lambda.v'), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('tool', 'openroad', 'task', 'floorplan', 'var', 'rtlmp_enable', 'true')
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/heartbeat/heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand All @@ -21,7 +22,7 @@ def setup(target=asap7_demo):
for src in ('heartbeat.v',):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

return chip
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/ibex/ibex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand Down Expand Up @@ -55,7 +56,7 @@ def setup(target=asap7_demo):

chip.add('option', 'define', 'SYNTHESIS')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

if mainlib.startswith('asap7sc7p5t'):
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/jpeg/jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand Down Expand Up @@ -36,7 +37,7 @@ def setup(target=asap7_demo):
'zigzag.v'):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

# Lint setup
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/mock_alu/mock_alu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand Down Expand Up @@ -44,7 +45,7 @@ def setup(target=asap7_demo):
chip.add('tool', 'chisel', 'task', 'convert', 'var', 'argument',
f'--operations {",".join(operations)}')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.add('tool', 'chisel', 'task', 'convert', 'var', 'argument', '--tech none')
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/openmsp430/openmsp430.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import skywater130_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand Down Expand Up @@ -46,7 +47,7 @@ def setup(target=skywater130_demo):
'omsp_clock_mux.v'):
chip.input(os.path.join(src_root, src), package='openmsp430')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

return chip
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/picorv32/picorv32.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import skywater130_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand All @@ -24,7 +25,7 @@ def setup(target=skywater130_demo):
for src in ('picorv32.v',):
chip.input(src, package='picorv32')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

return chip
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/riscv32i/riscv32i.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import skywater130_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand Down Expand Up @@ -46,7 +47,7 @@ def setup(target=skywater130_demo):
'top.v'):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

# Lint setup
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/spi/spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand All @@ -21,7 +22,7 @@ def setup(target=asap7_demo):
for src in ('spi.v',):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

return chip
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/swerv/swerv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand Down Expand Up @@ -77,7 +78,7 @@ def setup(target=asap7_demo):

chip.add('option', 'define', 'PHYSICAL')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

# Lint setup
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/tiny_rocket/tiny_rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import freepdk45_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery.designs import _common
from scgallery import Gallery

Expand All @@ -27,7 +28,7 @@ def setup(target=freepdk45_demo):
'plusarg_reader.v'):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

chip.set('option', 'define', 'SYNTHESIS')
Expand Down
3 changes: 2 additions & 1 deletion scgallery/designs/uart/uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from siliconcompiler import Chip
from siliconcompiler.targets import asap7_demo
from siliconcompiler.tools._common.asic import get_mainlib
from scgallery import Gallery


Expand All @@ -24,7 +25,7 @@ def setup(target=asap7_demo):
'uart_rx.v'):
chip.input(os.path.join(src_root, src), package='scgallery-designs')

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)
chip.input(os.path.join(sdc_root, f'{mainlib}.sdc'), package='scgallery-designs')

# Lint setup
Expand Down
3 changes: 2 additions & 1 deletion scgallery/rules.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
from siliconcompiler import Chip, SiliconCompilerError
from siliconcompiler.tools._common.asic import get_mainlib
import os
import sys
import json
Expand Down Expand Up @@ -135,7 +136,7 @@ def create_rules(chip):
def update_rules(chip, method, rules):
rules["date"] = datetime.now().strftime("%Y/%m/%d %H:%M:%S")

mainlib = chip.get('asic', 'logiclib')[0]
mainlib = get_mainlib(chip)

if mainlib not in rules:
raise ValueError(f'{mainlib} is missing from rules')
Expand Down

0 comments on commit 2bbb2ec

Please sign in to comment.