Andrei Stefanescu
f22a33aefe
[refinement] Refine one function at a time.
2019-02-01 16:29:13 -08:00
Andrei Stefanescu
595c98efb8
Add proper mkBlockPathCFG.
2019-02-01 16:13:35 -08:00
Tristan Ravitch
f260dad575
Turn fail-stop errors into macaw translation failures
...
Previously, macaw-ppc (and macaw-arm) would call `error` if there were no
semantics available for a decoded instruction. This was useful during initial
development, but it is a problem for deployment. Now just turn missing
semantics into TranslationErrors, which appear as block terminators in macaw IR.
This will require more diligence in monitoring TranslationErrors for patterns
that need to be addressed.
2019-02-01 08:37:50 -08:00
Kevin Quick
beb0f95c0b
[refinement] Provide list of forward path blocks to smt solving.
...
Currently smt solving just uses the first block of the first path,
which is not correct, but the framework for providing the list of
paths is now present.
2019-02-01 00:17:03 -08:00
Kevin Quick
2cbccd768c
Merge branch 'refinement' of github.com:GaloisInc/macaw into refinement
2019-01-31 22:29:59 -08:00
Kevin Quick
f282ac6913
[refinement] remove uneeded case catchall.
2019-01-31 22:29:31 -08:00
Kevin Quick
f60b39162c
[refinement] whitespace formatting.
2019-01-31 22:29:14 -08:00
Kevin Quick
243f70c9e6
[refinement] explicitly import Prelude last to avoid unneeded import errs.
2019-01-31 22:27:59 -08:00
Andrei Stefanescu
1e2e9aaee0
[refinement] Use mkBlockPathCFG.
2019-01-31 21:50:38 -08:00
Andrei Stefanescu
8ee9196cf6
Add Crucible translation of block paths.
2019-01-31 21:48:44 -08:00
Kevin Quick
5c2e0edeaa
[refinement] implement getBlock block lookup function.
2019-01-31 17:44:43 -08:00
Kevin Quick
bd0e57cfc1
[refinement] Invoke SMT solution at path-focused framework location.
...
The previous implementation invoked the SMT solver at the top level
for prototyping. This version moves the SMT solver invocation to the
intended location in the algorithm where the path is successively
extended and solutions are compared to identify the "best" refinement
solution.
2019-01-31 17:10:48 -08:00
Kevin Quick
ff2ec55f2c
[refinement] update run-refinement tool for changes in library.
...
Additional constraints and the refinement operations are now run in a
MonadIO context.
2019-01-31 14:55:26 -08:00
Andrei Stefanescu
23d67998ce
[refinement] Test finding successors for a single unclassified macaw block.
2019-01-30 20:27:35 -08:00
Andrei Stefanescu
620b54e5af
Handle all ParsedTermStmt constructors in termStmtToReturn.
2019-01-30 20:24:03 -08:00
Kevin Quick
9ba5473302
[refinement] only run refined tests if specified.
...
This prevents refined validation tests from causing problems with base
tests when only the latter is being run.
2019-01-30 09:14:22 -08:00
Kevin Quick
375dd1d656
[refinement] disable PPC testing temporarily
2019-01-30 09:13:52 -08:00
Kevin Quick
1b99c43518
[refinement] run tests only over specified architectures.
2019-01-30 09:13:38 -08:00
Kevin Quick
ebde669a24
[refinement] group tests by name.
2019-01-30 09:12:02 -08:00
Andrei Stefanescu
2efd7bc0e6
Fixes.
2019-01-29 16:29:54 -08:00
Andrei Stefanescu
8bd3ea41d1
Merge branch 'refinement' of github.com:GaloisInc/macaw into refinement
2019-01-29 14:54:06 -08:00
Andrei Stefanescu
5115bce70b
Propagate MonadIO constraint.
2019-01-29 14:54:03 -08:00
Kevin Quick
d2913bb5fe
Merge branch 'refinement' of github.com:GaloisInc/macaw into refinement
2019-01-29 14:33:51 -08:00
Kevin Quick
9945a2898e
[refinement] some updates/fixes to FuncBlockPath building.
2019-01-29 14:33:15 -08:00
Kevin Quick
e410b88b36
[refinement] update FuncBlockPath data element haddocks.
2019-01-29 14:32:05 -08:00
Andrei Stefanescu
8eaa0ba377
[refinement] Use flat memory model.
2019-01-29 12:16:21 -08:00
Luke Maurer
957addd204
CrucGen: Use SetStruct rather than making a new one from scratch
...
This means far fewer instructions (and hence fewer registers), and in
turn a lot less heap space. Peak memory usage is cut in half running
Brittle on a PPC64 exe with standard library.
2019-01-29 10:37:38 -08:00
Luke Maurer
b049a52ae9
CrucGen: Cache BV<->Ptr conversions
...
There was a fair amount of churn in generated Crucible CFGs due to
values redundantly getting converted back and forth.
2019-01-29 10:01:36 -08:00
Tristan Ravitch
76c7bd4ef7
Merge pull request #23 from GaloisInc/wip/cleaner-failure
...
Change some calls to `fail` into translation errors
2019-01-29 07:24:37 -08:00
Andrei Stefanescu
d826b6989a
Merge branch 'refinement' of github.com:GaloisInc/macaw into refinement
2019-01-29 01:25:09 -08:00
Andrei Stefanescu
aac908a595
[refinement] Generate IP candidate for single basic block.
2019-01-29 01:23:37 -08:00
Andrei Stefanescu
2620993d3c
Add register lookup and update functions in X86 ArchVals.
2019-01-29 01:22:27 -08:00
Andrei Stefanescu
533dc131a4
Add register lookup and update functions in ArchVals.
2019-01-29 01:21:25 -08:00
Kevin Quick
0ad281c853
[refinement] Implement determination of block transfer target addr(s).
2019-01-28 16:07:25 -08:00
Kevin Quick
9af8877cbd
[refinement] A block may transfer to multiple destinations (ite).
2019-01-28 15:18:32 -08:00
Kevin Quick
e5f1a60c88
[refinement] implement back-path builder.
2019-01-28 15:06:44 -08:00
Kevin Quick
dafc6252b4
[refinement] more haddock documentation for the Path module.
2019-01-28 15:05:47 -08:00
Kevin Quick
de06514a06
[refinement] Add pretty printer for FuncBlockPath.
2019-01-28 15:04:21 -08:00
Kevin Quick
87b3494f77
[refinement] add documentation for takePath function.
2019-01-28 15:02:43 -08:00
Kevin Quick
183ec2661d
[refinement] implement pathTo: find back-path to a specific block.
2019-01-28 15:01:46 -08:00
Kevin Quick
f9e179fb46
[refinement] Add MemWidth constraint.
2019-01-28 15:00:25 -08:00
Kevin Quick
53cf6acdf0
[refinement] sort/format imports for UnknownTransfer.
2019-01-28 14:58:05 -08:00
Luke Maurer
8d3c501fd0
Coerce PPCTermStmts rather than returning new ones when rewriting
...
This was eating up a surprising amount of heap space.
2019-01-28 14:48:25 -08:00
Luke Maurer
7d720b74f6
Add new crucGenRegStructType to MacawSymbolicArchFunctions for PPC
2019-01-28 14:48:25 -08:00
Luke Maurer
5a8fba6d08
Cache TypeRepr
and Position
values
...
Generating the type of the register structure on demand was causing
`TypeRepr` to be the biggest chunk of the heap. Similarly, we only need
to create a new `Position` when we change the offset.
2019-01-28 14:47:06 -08:00
Luke Maurer
bc5442a223
Force entire statement list when filtering it
...
Keeping it lazy meant that the entire list would stick around in memory
for a while; now the statements that aren't kept are garbage-collected.
2019-01-28 14:47:06 -08:00
Luke Maurer
12daa3a17b
Make CrucGen stricter
...
Most crucially, make the `CrucGen` monad itself strict. The heap was
filling up with old `CrucGenState`s being held onto by unevaluated
computations, since *every* computation was lazy. Plugged a few other
sources of `CrucGenState` leaks as well.
2019-01-28 14:47:06 -08:00
Kevin Quick
138666b410
[refinement] a function may have multiple paths to different exit points.
...
An "exit point" is a block which does not transfer to another block
within the function. An exit may be a RET or a JMP or an ite
representing different JMP targets; at this time it is assumed that
the latter cannot mix external and internal JMP targets.
2019-01-28 11:14:33 -08:00
Kevin Quick
263f852924
[refinement] Split out modules for Path handling, Function/Block utilities.
2019-01-28 10:50:35 -08:00
Kevin Quick
6412cd6312
[refinement] build trivial path (just initial block)
2019-01-26 13:34:01 -08:00