From: Florent Kermarrec Date: Sun, 26 Aug 2012 13:44:43 +0000 (+0200) Subject: tb_TriggerCsr.py : use truth table generator for Sum Lut X-Git-Tag: 24jan2021_ls180~2575^2~166 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97cca81e0cde05380e9bfe79f7303f41ca3f958b;p=litex.git tb_TriggerCsr.py : use truth table generator for Sum Lut --- 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