mirror of https://github.com/openXC7/prjxray.git
Simplify bit definition.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
parent
bf817f3548
commit
dde035c7ee
|
|
@ -10,8 +10,7 @@ build/segbits_bramx.rdb: $(SPECIMENS_OK)
|
|||
build/segbits_bramx.db: build/segbits_bramx.rdb
|
||||
${XRAY_DBFIXUP} --db-root build --zero-db bits.dbf \
|
||||
--seg-fn-in build/segbits_bramx.rdb \
|
||||
--seg-fn-out build/segbits_bramx.unmerged.db
|
||||
python3 merge_in_use.py build/segbits_bramx.unmerged.db > build/segbits_bramx.db
|
||||
--seg-fn-out build/segbits_bramx.db
|
||||
${XRAY_MASKMERGE} build/mask_bramx.db $(addsuffix /segdata_bram_[lr].txt,$(SPECIMENS))
|
||||
|
||||
pushdb:
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
27_150,BRAM.RAMB18_Y0.RAM_IN_USE
|
||||
27_169,BRAM.RAMB18_Y1.RAM_IN_USE
|
||||
|
|
@ -27,10 +27,8 @@ def main():
|
|||
for param, tag in (
|
||||
('Y0_IN_USE', 'RAMB18_Y0.IN_USE'),
|
||||
('Y1_IN_USE', 'RAMB18_Y1.IN_USE'),
|
||||
('RAMB_Y0_IN_USE', 'RAMB18_Y0.RAM_IN_USE'),
|
||||
('RAMB_Y1_IN_USE', 'RAMB18_Y1.RAM_IN_USE'),
|
||||
('FIFO_Y0_IN_USE', 'RAMB18_Y0.FIFO_IN_USE'),
|
||||
('FIFO_Y1_IN_USE', 'RAMB18_Y1.FIFO_IN_USE'),
|
||||
('FIFO_Y0_IN_USE', 'RAMB18_Y0.FIFO_MODE'),
|
||||
('FIFO_Y1_IN_USE', 'RAMB18_Y1.FIFO_MODE'),
|
||||
):
|
||||
segmk.add_tile_tag(tile_param['tile'], tag, tile_param[param])
|
||||
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
""" Merge IN_USE entries.
|
||||
|
||||
Segmatch has trouble directly solving for RAM_IN_USE and FIFO_IN_USE.
|
||||
Instead if solves for IN_USE (e.g. RAM_IN_USE or FIFO_IN_USE) and the FIFO_IN_USE bit.
|
||||
|
||||
This tool merges the 3 entries into 2 entries RAM_IN_USE and FIFO_IN_USE.
|
||||
|
||||
|
||||
BRAM.RAMB18_Y0.FIFO_IN_USE 27_150
|
||||
BRAM.RAMB18_Y0.IN_USE 27_100 27_99
|
||||
BRAM.RAMB18_Y0.RAM_IN_USE !27_150
|
||||
|
||||
becomes
|
||||
|
||||
BRAM.RAMB18_Y0.FIFO_IN_USE 27_100 27_99 27_150
|
||||
BRAM.RAMB18_Y0.RAM_IN_USE 27_100 27_99 !27_150
|
||||
|
||||
"""
|
||||
import argparse
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
|
||||
parser.add_argument('unmerged_db')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
site_parts = {}
|
||||
|
||||
with open(args.unmerged_db) as f:
|
||||
for l in f:
|
||||
parts = l.strip().split(' ')
|
||||
|
||||
feature = parts[0]
|
||||
bits = parts[1:]
|
||||
|
||||
feature_parts = feature.split('.')
|
||||
|
||||
assert feature_parts[0] == 'BRAM'
|
||||
assert feature_parts[1] in ('RAMB18_Y0', 'RAMB18_Y1')
|
||||
site = feature_parts[1]
|
||||
|
||||
if site not in site_parts:
|
||||
site_parts[site] = {}
|
||||
|
||||
site_parts[site][feature_parts[2]] = bits
|
||||
|
||||
assert len(site_parts) == 2
|
||||
for site in site_parts:
|
||||
assert 'IN_USE' in site_parts[site]
|
||||
assert len(site_parts[site]) == 3
|
||||
|
||||
for feature in site_parts[site]:
|
||||
if feature == 'IN_USE':
|
||||
continue
|
||||
|
||||
print('BRAM.{site}.{feature} {bits}'.format(
|
||||
site=site,
|
||||
feature=feature,
|
||||
bits=' '.join(site_parts[site]['IN_USE'] + site_parts[site][feature])))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -32,8 +32,6 @@ def ramb18(tile_name, luts, lines, sites):
|
|||
params['tile'] = tile_name
|
||||
params['Y0_IN_USE'] = random.randint(0, 1) == 1
|
||||
params['Y1_IN_USE'] = not params['Y0_IN_USE']
|
||||
params['RAMB_Y0_IN_USE'] = params['Y0_IN_USE']
|
||||
params['RAMB_Y1_IN_USE'] = params['Y1_IN_USE']
|
||||
params['FIFO_Y0_IN_USE'] = False
|
||||
params['FIFO_Y1_IN_USE'] = False
|
||||
|
||||
|
|
@ -62,8 +60,6 @@ def ramb18_2x(tile_name, luts, lines, sites):
|
|||
params['tile'] = tile_name
|
||||
params['Y0_IN_USE'] = True
|
||||
params['Y1_IN_USE'] = True
|
||||
params['RAMB_Y0_IN_USE'] = True
|
||||
params['RAMB_Y1_IN_USE'] = True
|
||||
params['FIFO_Y0_IN_USE'] = False
|
||||
params['FIFO_Y1_IN_USE'] = False
|
||||
|
||||
|
|
@ -91,8 +87,6 @@ def ramb36(tile_name, luts, lines, sites):
|
|||
params['tile'] = tile_name
|
||||
params['Y0_IN_USE'] = True
|
||||
params['Y1_IN_USE'] = True
|
||||
params['RAMB_Y0_IN_USE'] = True
|
||||
params['RAMB_Y1_IN_USE'] = True
|
||||
params['FIFO_Y0_IN_USE'] = False
|
||||
params['FIFO_Y1_IN_USE'] = False
|
||||
|
||||
|
|
@ -182,8 +176,6 @@ def fifo18(tile_name, luts, lines, sites):
|
|||
params['tile'] = tile_name
|
||||
params['Y0_IN_USE'] = True
|
||||
params['Y1_IN_USE'] = False
|
||||
params['RAMB_Y0_IN_USE'] = False
|
||||
params['RAMB_Y1_IN_USE'] = False
|
||||
params['FIFO_Y0_IN_USE'] = True
|
||||
params['FIFO_Y1_IN_USE'] = False
|
||||
|
||||
|
|
@ -218,8 +210,6 @@ def fifo18_ramb18(tile_name, luts, lines, sites):
|
|||
params['tile'] = tile_name
|
||||
params['Y0_IN_USE'] = True
|
||||
params['Y1_IN_USE'] = True
|
||||
params['RAMB_Y0_IN_USE'] = False
|
||||
params['RAMB_Y1_IN_USE'] = True
|
||||
params['FIFO_Y0_IN_USE'] = True
|
||||
params['FIFO_Y1_IN_USE'] = False
|
||||
|
||||
|
|
@ -257,8 +247,6 @@ def fifo36(tile_name, luts, lines, sites):
|
|||
params['tile'] = tile_name
|
||||
params['Y0_IN_USE'] = True
|
||||
params['Y1_IN_USE'] = True
|
||||
params['RAMB_Y0_IN_USE'] = False
|
||||
params['RAMB_Y1_IN_USE'] = False
|
||||
params['FIFO_Y0_IN_USE'] = True
|
||||
params['FIFO_Y1_IN_USE'] = True
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue