def test_mem_hier_at_error(self): ''' Accessor mem_hier error. ''' cost = Cost( mac_op=1, mem_hier=(200, 6, 2, 1), noc_hop=10, unit_static=0, ) self.assertIsNone(cost.mem_hier_at(me.NUM)) self.assertIsNone(cost.mem_hier_at(None))
def test_mem_hier_at(self): ''' Accessor mem_hier. ''' cost = Cost( mac_op=1, mem_hier=(200, 6, 2, 1), noc_hop=10, unit_static=0, ) self.assertEqual(cost.mem_hier_at(me.DRAM), 200, 'mem_hier: DRAM') self.assertEqual(cost.mem_hier_at(me.GBUF), 6, 'mem_hier: GBUF') self.assertEqual(cost.mem_hier_at(me.ITCN), 2, 'mem_hier: ITCN') self.assertEqual(cost.mem_hier_at(me.REGF), 1, 'mem_hier: REGF')