From 2a3088ca16babe0ce74d6e7205f4c0301c1eb56d Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 25 Sep 2018 09:33:46 -0700 Subject: Fix implementation cmp+condition version of if in CPU DSL --- cpu_dsl.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cpu_dsl.py') diff --git a/cpu_dsl.py b/cpu_dsl.py index a836541..307f9e8 100755 --- a/cpu_dsl.py +++ b/cpu_dsl.py @@ -566,10 +566,8 @@ class Switch(ChildBlock): def _geuCImpl(prog, parent, fieldVals, output): if prog.lastOp.op == 'cmp': output.pop() - params = prog.lastOp.params - for i in range(0, len(params)): - params[i] = prog.resolveParam(params[i], parent, fieldVals) - return '\n\tif ({a} >= {b}) '.format(a=params[0], b = params[1]) + '{' + params = [prog.resolveParam(p, parent, fieldVals) for p in prog.lastOp.params] + return '\n\tif ({a} >= {b}) '.format(a=params[1], b = params[0]) + '{' else: raise ion(">=U not implemented in the general case yet") -- cgit v1.2.3