Skip to content

Commit

Permalink
updated tests to hopefully fix spydrnet example netlist issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdbrown4 committed Nov 7, 2023
1 parent c186e75 commit ed110bb
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion spydrnet_tmr/analysis/tests/test_adjacency_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TestAdjacencyList(unittest.TestCase):

def test_adjacency_list(self):
netlist = sdn.load_example_netlist_by_name('b13')
netlist = sdn.load_example_netlist_by_name('b13', force_download=True)
hports = netlist.get_hports()
hinstances = netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True)
from itertools import chain
Expand Down
2 changes: 1 addition & 1 deletion spydrnet_tmr/analysis/tests/test_feedback_folding.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class TestFeedbackFolding(unittest.TestCase):
def test_feedback_folding(self):
netlist = sdn.load_example_netlist_by_name("b13")
netlist = sdn.load_example_netlist_by_name("b13", force_download=True)
hports = netlist.get_hports(
filter=lambda x: x.name not in {"clk", "srst"}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class TestVoterInsertionBeforeFF(unittest.TestCase):
def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("b13")
self.netlist = sdn.load_example_netlist_by_name("b13", force_download=True)
uniquify(self.netlist)
hinstances_to_replicate = self.netlist.get_hinstances(
recursive=True,
Expand Down Expand Up @@ -45,7 +45,7 @@ def test_voter_count(self):

class TestVoterInsertionAfterFF(unittest.TestCase):
def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("b13")
self.netlist = sdn.load_example_netlist_by_name("b13", force_download=True)
uniquify(self.netlist)
hinstances_to_replicate = self.netlist.get_hinstances(
recursive=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class TestVoterInsertion(unittest.TestCase):
def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("b13")
self.netlist = sdn.load_example_netlist_by_name("b13", force_download=True)
uniquify(self.netlist)
hinstances_to_replicate = list(
self.netlist.get_hinstances(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class TestIdentifyReductionPoints(unittest.TestCase):
def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("b13")
self.netlist = sdn.load_example_netlist_by_name("b13", force_download=True)
uniquify(self.netlist)
hinstances_to_replicate = list(
self.netlist.get_hinstances(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TestIdentifyReductionPoints(unittest.TestCase):

def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("b13")
self.netlist = sdn.load_example_netlist_by_name("b13", force_download=True)
uniquify(self.netlist)
hinstances_to_replicate = list(self.netlist.get_hinstances(recursive=True,filter=lambda x: x.item.reference.is_leaf() is True))
instances_to_replicate = list(x.item for x in hinstances_to_replicate)
Expand Down
2 changes: 1 addition & 1 deletion spydrnet_tmr/f4pga/tests/test_fix_unconn_nets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class TestFixUnconnNets(unittest.TestCase):
def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("synchronouscounter_nocarry", EBLIF)
self.netlist = sdn.load_example_netlist_by_name("synchronouscounter_nocarry", EBLIF, force_download=True)
self.unconn_pins = list()
for instance in self.netlist.get_instances():
for pin in instance.get_pins(selection=Selection.OUTSIDE, filter=lambda x: x.inner_pin.port.direction is sdn.OUT):
Expand Down
2 changes: 1 addition & 1 deletion spydrnet_tmr/f4pga/tests/test_update_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class TestUpdateConstraints(unittest.TestCase):
def setUp(self):
self.netlist = sdn.load_example_netlist_by_name("synchronouscounter_nocarry", EBLIF)
self.netlist = sdn.load_example_netlist_by_name("synchronouscounter_nocarry", EBLIF, force_download=True)
self.instance = next(self.netlist.get_instances(filter=lambda x: self.filter(x)))
constraint_info = "\"count[0]:U17\""
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def generate_netlists(self,example_to_test,copy_amount,suffix,organ=None,organ_n
'''
Generates netlists needed for testing by selecting a random example from a list of small netlists, replicating the design, and composing the netlist.
'''
netlist = sdn.load_example_netlist_by_name(example_to_test)
netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)

uniquify(netlist)
sdn.compose(netlist,example_to_test + ".edf")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def generate_netlists(self,example_to_test,copy_amount,suffix):
'''
Generates netlists needed for testing by selecting a random example from a list of small netlists, replicating the design, and composing the netlist.
'''
netlist = sdn.load_example_netlist_by_name(example_to_test)
netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)
uniquify(netlist)

hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def remove_files(self):
class TestOrganInsertion2(unittest.TestCase):

def setUp(self):
self.netlist = sdn.load_example_netlist_by_name('b13')
self.netlist = sdn.load_example_netlist_by_name('b13', force_download=True)
uniquify(self.netlist)
ignore = ["OBUF",'OUTBUF','VCC']
self.hinstances_to_replicate = list(self.netlist.get_hinstances(recursive=True, filter=lambda x:(x.item.reference.is_leaf() and not any(ignore_name in x.item.name for ignore_name in ignore))is True))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def generate_netlists(self,example_to_test,copy_amount,suffix,organ=None,organ_n
'''
Generates netlists needed for testing by selecting a random example from a list of small netlists, replicating the design, and composing the netlist.
'''
netlist = sdn.load_example_netlist_by_name(example_to_test)
netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)
uniquify(netlist)
sdn.compose(netlist,example_to_test + ".edf")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUp(self):
random_value = randint(0,len(examples_list)-1)
example_to_test = examples_list[random_value]

netlist = sdn.load_example_netlist_by_name(example_to_test)
netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)
uniquify(netlist)

hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_switch_organ_pins_primary_input(self):

def generate_netlist(self):
example_name = self.example_name
netlist = sdn.load_example_netlist_by_name(example_name)
netlist = sdn.load_example_netlist_by_name(example_name, force_download=True)
uniquify(netlist)
hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
instances_to_replicate = list(x.item for x in hinstances_to_replicate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_drc_pass(self):
self.assertTrue(check_nmr(netlist,[*hinstances_to_replicate, *hports_to_replicate], 3, 'TMR'))

def test_drc_pass_2(self):
netlist = sdn.load_example_netlist_by_name('lfsr_zybo')
netlist = sdn.load_example_netlist_by_name('lfsr_zybo', force_download=True)
uniquify(netlist)
ignore_types = ['OBUF','OUTBUF','segment','anode','VCC','GND']
hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.is_leaf() and all(x.item.name not in ignore for ignore in ignore_types)))
Expand All @@ -34,7 +34,7 @@ def test_drc_pass_2(self):
self.assertTrue(check_nmr(netlist,[*hinstances_to_replicate, *hports_to_replicate], 3, 'TMR'),self.example_to_test)

def test_drc_fail(self):
netlist = sdn.load_example_netlist_by_name(self.example_to_test)
netlist = sdn.load_example_netlist_by_name(self.example_to_test, force_download=True)
uniquify(netlist)
hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
instances_to_replicate = list(x.item for x in hinstances_to_replicate)
Expand All @@ -45,7 +45,7 @@ def test_drc_fail(self):
self.assertFalse(check_nmr(netlist,[], 3, 'TMR'))

def test_drc_fail_2(self):
netlist = sdn.load_example_netlist_by_name(self.example_to_test)
netlist = sdn.load_example_netlist_by_name(self.example_to_test, force_download=True)
uniquify(netlist)
hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
instances_to_replicate = list(x.item for x in hinstances_to_replicate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def generate_netlists(self,example_to_test,copy_amount,suffix,organ=None,organ_n
'''
Generates netlists needed for testing by selecting a random example from a list of small netlists, replicating the design, and composing the netlist.
'''
netlist = sdn.load_example_netlist_by_name(example_to_test)
netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)

uniquify(netlist)
sdn.compose(netlist,example_to_test + ".edf")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestDRCCInsertOrgans(unittest.TestCase):
'''
def setUp(self):
example_name = 'b13'
netlist = sdn.load_example_netlist_by_name(example_name)
netlist = sdn.load_example_netlist_by_name(example_name, force_download=True)
uniquify(netlist)
hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
instances_to_replicate = list(x.item for x in hinstances_to_replicate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def generate_netlists(self,example_to_test,copy_amount,suffix,organ=None,organ_n
'''
Generates netlists needed for testing by selecting a random example from a list of small netlists, replicating the design, and composing the netlist.
'''
netlist = sdn.load_example_netlist_by_name(example_to_test)
netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)
uniquify(netlist)
sdn.compose(netlist,example_to_test + ".edf")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setUp(self):
random_value = randint(0,len(examples_list)-1)
example_to_test = examples_list[random_value]

self.netlist = sdn.load_example_netlist_by_name(example_to_test)
self.netlist = sdn.load_example_netlist_by_name(example_to_test, force_download=True)
uniquify(self.netlist)

hinstances_to_replicate = list(self.netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestDRCUniquifyNmrProperty(unittest.TestCase):
'''
def setUp(self):
example_name = 'b13'
netlist = sdn.load_example_netlist_by_name(example_name)
netlist = sdn.load_example_netlist_by_name(example_name, force_download=True)
uniquify(netlist)
hinstances_to_replicate = list(netlist.get_hinstances(recursive=True, filter=lambda x: x.item.reference.is_leaf() is True))
instances_to_replicate = list(x.item for x in hinstances_to_replicate)
Expand Down

0 comments on commit ed110bb

Please sign in to comment.