| Summary: | isa simulator appears to calculate wrong result for test_divwuo_regression_1 | ||
|---|---|---|---|
| Product: | Libre-SOC's first SoC | Reporter: | Jacob Lifshay <programmerjake> |
| Component: | Source Code | Assignee: | Luke Kenneth Casson Leighton <lkcl> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | libre-soc-bugs, lkcl, programmerjake |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: | https://bugs.libre-soc.org/show_bug.cgi?id=413 | ||
| NLnet milestone: | --- | total budget (EUR) for completion of task and all subtasks: | 0 |
| budget (EUR) for this task, excluding subtasks' budget: | 0 | parent task for budget allocation: | |
| child tasks for budget allocation: | The table of payments (in EUR) for this task; TOML format: | ||
| Bug Depends on: | |||
| Bug Blocks: | 325 | ||
|
Description
Jacob Lifshay
2020-07-23 03:42:02 BST
see comment on mailing list: http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2020-July/008637.html yep, that's down to changing of a "hack" function which is now
no longer appropriate
diff --git a/src/soc/decoder/pseudo/parser.py b/src/soc/decoder/pseudo/parser.py
index 346e3f98..3d75fbb0 100644
--- a/src/soc/decoder/pseudo/parser.py
+++ b/src/soc/decoder/pseudo/parser.py
@@ -615,7 +615,8 @@ class PowerParser:
l, r = p[1], p[3]
# actual call will be "dividend / divisor" - just check
# LHS name
- if isinstance(l, ast.Name) and l.id == 'dividend':
+ # XXX DISABLE BAD HACK (False)
+ if False and isinstance(l, ast.Name) and l.id == 'dividend':
if p[2] == '/':
fn = 'trunc_divs'
else:
this is related to that helper function that you wrote (which is great btw). it turns out that it's a signed (only) floor_div function, and that calling "standard" (python3) floordiv is appropriate in unsigned cases (such as divwuo) i had messed up the parser and called the wrong function since changing the pseudo-code to actually *explicitly* call DIVS: http://lists.mailinglist.openpowerfoundation.org/pipermail/openpower-hdl-cores/2020-July/000078.html |