From 97cca81e0cde05380e9bfe79f7303f41ca3f958b Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sun, 26 Aug 2012 15:44:43 +0200 Subject: [PATCH] tb_TriggerCsr.py : use truth table generator for Sum Lut --- sim/tb_TriggerCsr.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sim/tb_TriggerCsr.py b/sim/tb_TriggerCsr.py index 6990b6c2..7356bfc1 100644 --- a/sim/tb_TriggerCsr.py +++ b/sim/tb_TriggerCsr.py @@ -9,6 +9,8 @@ import sys sys.path.append("../") import migScope +from migScope.tools.truthtable import * + def term_prog(off, dat): for i in range(4): yield TWrite(off+3-i, (dat>>(8*i))&0xFF) @@ -43,6 +45,15 @@ def csr_transactions(): for t in sum_trans: for r in t: yield r + + sum_tt = gen_truth_table("i1 & i2 & i3 & i4") + sum_trans = [] + for i in range(len(sum_tt)): + sum_trans.append(sum_prog(0x00,i,sum_tt[i])) + print(sum_tt) + for t in sum_trans: + for r in t: + yield r global csr_done csr_done = True -- 2.30.2