Skip to content

Commit

Permalink
Merge pull request #4771 from pepijndevos/famxtra
Browse files Browse the repository at this point in the history
gowin: split cells_xtra by family
  • Loading branch information
mmicko authored Dec 8, 2024
2 parents fa0c311 + be836f4 commit f4ddbc3
Show file tree
Hide file tree
Showing 7 changed files with 6,324 additions and 6,308 deletions.
4 changes: 3 additions & 1 deletion techlibs/gowin/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ OBJS += techlibs/gowin/synth_gowin.o

$(eval $(call add_share_file,share/gowin,techlibs/gowin/cells_map.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/cells_sim.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/cells_xtra.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/cells_xtra_gw1n.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/cells_xtra_gw2a.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/cells_xtra_gw5a.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/arith_map.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/brams_map.v))
$(eval $(call add_share_file,share/gowin,techlibs/gowin/brams.txt))
Expand Down
25 changes: 13 additions & 12 deletions techlibs/gowin/cells_xtra.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ def xtract_cells_decl(dir, fout):
parser.add_argument('gowin_dir', nargs='?', default='/opt/gowin/')
args = parser.parse_args()

dirs = [
os.path.join(args.gowin_dir, 'IDE/simlib/gw1n/'),
os.path.join(args.gowin_dir, 'IDE/simlib/gw2a/'),
os.path.join(args.gowin_dir, 'IDE/simlib/gw5a/'),
]
families = {
'gw1n': os.path.join(args.gowin_dir, 'IDE/simlib/gw1n/'),
'gw2a': os.path.join(args.gowin_dir, 'IDE/simlib/gw2a/'),
'gw5a': os.path.join(args.gowin_dir, 'IDE/simlib/gw5a/'),
}

with open('cells_xtra.v', 'w') as fout:
fout.write('// Created by cells_xtra.py\n')
fout.write('\n')
for dir in dirs:
if not os.path.isdir(dir):
print(f'{dir} is not a directory')
xtract_cells_decl(dir, fout)
for family, dir in families.items():
if not os.path.isdir(dir):
print(f'{dir} is not a directory')
else:
with open(f'cells_xtra_{family}.v', 'w') as fout:
fout.write('// Created by cells_xtra.py\n')
fout.write('\n')
xtract_cells_decl(dir, fout)
Loading

0 comments on commit f4ddbc3

Please sign in to comment.