Skip to content

Commit cd4ca49

Browse files
committed
Update tests to fabric refactoring
Since the tilegrid.json file is not anymore placed inside the part directory, the test needs to be updated slightly to work with the new structure. Signed-off-by: Daniel Schultz <[email protected]>
1 parent e986737 commit cd4ca49

File tree

8 files changed

+32
-4
lines changed

8 files changed

+32
-4
lines changed

tests/test_util.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# SPDX-License-Identifier: ISC
1111

12-
from os import environ, getcwd, chdir
12+
from os import environ, getcwd, chdir, mkdir, environ
1313
import json
1414
from tempfile import TemporaryDirectory
1515
from contextlib import contextmanager
@@ -19,7 +19,7 @@
1919
# in the current subdirectory, which will be a temporary one, to allow concurent
2020
# testing.
2121
environ['XRAY_DATABASE_ROOT'] = '.'
22-
environ['XRAY_PART'] = './'
22+
environ['XRAY_PART'] = 'xc7a200tffg1156-1'
2323

2424
from prjxray.util import get_roi, get_db_root
2525
from prjxray.overlay import Overlay
@@ -31,9 +31,18 @@ def setup_database(contents):
3131
with TemporaryDirectory() as d:
3232
olddir = getcwd()
3333
chdir(d)
34+
mkdir('xc7a200t')
35+
mkdir('mapping')
36+
environ['XRAY_DATABASE_ROOT'] = d
3437
e = None
35-
with open('tilegrid.json', 'w') as fd:
38+
with open('xc7a200t/tilegrid.json', 'w') as fd:
3639
json.dump(contents, fd)
40+
# Create some dummy data
41+
with open('mapping/devices.yaml', 'w') as fd:
42+
json.dump({'xc7a200t': {'fabric': "xc7a200t"}}, fd)
43+
with open('mapping/parts.yaml', 'w') as fd:
44+
json.dump({'xc7a200tffg1156-1': {"device": "xc7a200t"}}, fd)
45+
3746
try:
3847
yield
3948
except Exception as ereal:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# device to fabric mapping
2+
"xc7a200t":
3+
fabric: "xc7a200t"

utils/test_data/db/mapping/parts.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# part number to device, package and speed grade mapping
2+
"xc7a200tffg1156-1":
3+
device: "xc7a200t"
4+
package: "ffg1156"
5+
speedgrade: "1"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# part number to pins
2+
"xc7a200tffg1156-1":
3+
pins:
4+
0: "R26"
5+
1: "P26"
6+
2: "N26"
7+
3: "M27"
8+
4: "U25"
9+
5: "T25"
10+
6: "P24"

utils/test_fasm2frames.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def fasm2frames(self, fin_data, **kw):
7979

8080
fout = StringIO()
8181
fasm2frames.run(
82-
self.filename_test_data('db'), "xc7", fin.name, fout, **kw)
82+
self.filename_test_data('db'), "xc7a200tffg1156-1", fin.name,
83+
fout, **kw)
8384

8485
return fout.getvalue()
8586

0 commit comments

Comments
 (0)