Commit Graph

29 Commits

Author SHA1 Message Date
Brett Boston
82640e7a4b
Add RISC-V backend (#259)
* riscv: added grift as submodule

* added macaw-riscv project

* make arch polykinded everywhere in macaw base

* stubbed out riscv_info

* update grift

* started on RISCVReg

* started on RISCVReg

* RegisterInfo instance for RISCVReg (a few unimplemented fields)

* filled out archRegSet

* filled out withArchConstraints, archAddrWidth, and archEndianness

* added Arch module

* RISCV initialBlockRegs

* preliminary work on disassembleFn

* wip: disassembleFn

* made things more lens-y

* wip: disassemble instruction

* finished disassembly of grift assignment statements

* separated out DisInstM into separate module

* disassembly wip

* finished disassembleBlock

* Finished riscvDisassembleFn

* bump grift submodule

* made macaw discovery poly-kinded

* added risc-v test suite

* added risc-v test suite

* fixed macaw semantics to hardware x0 to constant value 0

* added riscvPreserveReg based on assembler's manual

* riscvDemandContext

* successfully disassembled a block!

* enhanced tests to allow optional entry point spec

* stubbed out identifyCall

* stubbed out identifyReturn

* passing initial test

* added checkForReturnAddr stub

* fleshed out identifyCall and identifyReturn

* update grift submodule

* bug fix and exception handling

* added EXC register, which tracks whether or not we've attempted to
read from/write to any system registers.

* Replaced custom CSR type with GRIFT's (but we're not using it
currently)

* added better show instance for GPRs we should migrate this to a
GRIFT pretty printer at some point)

* Fixed a vicious bug in the semantics; unsigned and signed LT were
getting swapped in translation

* added pattern synonyms for GPRs

* improved docs and fixed RISCVReg bug (GP was 3 instead of 4)

* changed undefineds to errors

* changed RISCV class to RISCVConstraints

* wrapped GRIFT's "RV" parameter in a type to remove the need to make
macaw architecture parameter polykinded

* rolled back all changes to macaw base that made things poly-kinded

* reverted two more macaw core changes, updated license, removed old PPC test

* macaw: update to upstream changes in bv-sized and grift

* address code review comments

* macaw-riscv: expose fewer modules

* Update RISCVTermStmt definition

* Update riscv_info.  macaw-riscv now builds against master

* Update bv-sized and cabal freeze files

* Update cabal freeze files with satisfying lens version

* Get tests building

* Fix printf runtime error

* Add simpler tests

* Change RISCV target version and update grift pointer

[skip ci]

* Compressed branch test passes

[skip ci]

* Add additional small tests

[skip ci]

* Introduce a syscall PrimFn

* Syscalls now correctly classified

* Fix return regs from syscall

* Extract syscall arguments

* Update expected riscv test results

* Add macaw-riscv build + test to CI

* Get building with GHC 9.0.2

* Revert "Update cabal freeze files with satisfying lens version"

This reverts commit 4aa95c19c3.

* Install softfloat in CI

* Update Grift

* Some initial cleanup

* More cleanup

* Resolve FIXME on getReg

* Detect and only accept rv64gc rvreprs

* Address Tristan's PR comments

* Update Grift pointer

* Add info on installing Softfloat to README for macaw-riscv

* Add missing submodule step to softfloat build instructions

Co-authored-by: Ben Selfridge <benselfridge@000279.local>
Co-authored-by: Valentin Robert <val@galois.com>
2022-03-04 12:44:46 -08:00
Ben Selfridge
039b8497fc
updates what4, crucible, etc. (#146)
* update to bv-sized branch of what4 and other things

* removed parameterized-utils submodule completely

* Updates submodules

* Fixes macaw-symbolic w.r.t. crucible-llvm changes

Co-authored-by: Ben Selfridge <ben@000548-benselfridge.local>
2020-06-16 16:49:55 -07:00
Daniel Matichuk
5dab9c5209 Merge remote-tracking branch 'origin/master' into feature/asl 2020-04-03 23:38:19 -07:00
Andrew Kent
3e5f52f11b bump semmc submodule, add what4-serialize dep 2020-03-18 12:01:17 -07:00
Ben Selfridge
16c08f72f8 updated crucible/what4 2020-03-10 14:26:55 -07:00
Tristan Ravitch
c825332f39
Update/ghc 8.8 (#112)
Updates for GHC 8.8

The two main classes of update are related to MonadFail and type alias expansion.

The MonadFail updates introduce explicit MonadFail instances and backward-compatible `fail` implementations under `Monad` for older GHC versions.

The type alias expansion rules changed in GHC 8.8 in a way that breaks the `Simple Lens` idiom; instead, we have to use `Lens'`.  Lens started supporting this alias in version 3.8, which was released in 2013.

This change includes necessary submodule updates, as well as the update for the split of what4 into its own repository.
2020-03-03 13:28:26 -08:00
Daniel Matichuk
a98dec23c0 bump submodules 2020-02-26 23:05:08 -08:00
Daniel Matichuk
ad10d389fb copy macaw-arm into macaw-asl 2020-02-24 15:39:41 -08:00
Tristan Ravitch
3da105d44e Remove unused submodules
We now use the hackage releases of these packages.
2019-11-12 18:13:00 -08:00
Tristan Ravitch
989cc65f7a Move active submodules from submodules to deps
This was an artifact of merging macaw-semmc into macaw.  This commit unifies the
two directories.  There are some remaining submodules in the old directory:
these are obsolete and will be removed in a separate commit.
2019-11-12 18:13:00 -08:00
Kevin Quick
11a2481135
Add llvm-pretty-bc-parser dependency. 2019-02-21 22:21:51 -08:00
Kevin Quick
101a638add
Eliminate duplication in submodules. 2019-02-18 11:42:24 -08:00
Kevin Quick
8aefd5224f
Merge ../macaw-semmc
Combined .gitignore rules and merged .gitmodules as the concatenation
of the individual .gitmodules; this will result in duplicate
submodules which will be resolved in a subsequent commit.
2019-02-18 09:44:31 -08:00
Kevin Quick
730f855c71
Update to use macaw-loader for uniform binary loading. 2018-10-29 15:51:42 -07:00
Tristan Ravitch
4ca53dfb5c Submodule updates
The code was already updated, but there were some missing submodule updates
2018-05-21 17:53:10 -07:00
Joe Hendrix
655491bae3
Fix repo urls 2018-04-25 00:32:43 -07:00
Joe Hendrix
72b667a49c
Add crucible so we can build macaw-symbolic on travis. 2018-04-25 00:16:53 -07:00
Joe Hendrix
000c2f900e
Move macaw stack.yaml to root for similiarity with other Galois packages. 2018-04-24 09:05:36 -07:00
Tristan Ravitch
1ebf0cabb7 Submodule updates
These updates include a new version of cabal required to build macaw-symbolic.
macaw-symbolic is also now added to the cabal.project file.
2018-03-29 09:57:17 -07:00
Tristan Ravitch
43babd43cf Add macaw-x86 to the cabal.project file 2018-03-28 17:00:38 -07:00
Kevin Quick
ce8ebff929 Switch back to main s-cargot package: pretty-printing is now fast. 2018-03-05 13:36:53 -08:00
Kevin Quick
8d020b18b8 Update (temporarily) to kquick branch of s-cargot with fast pretty-printing. 2018-02-16 13:48:16 -08:00
Kevin Quick
4a8a84ba9b Add s-cargot-letbind submodule. 2018-02-16 13:40:41 -08:00
Ben Selfridge
372301aecc s-cargot now under submodules 2018-01-31 16:44:16 -08:00
Ben Selfridge
8f99d9982f changed submodules to HTTPS origin to avoid authentication failure 2017-11-09 15:19:40 -08:00
Ben Selfridge
9caacd01ef added needed submodules 2017-11-09 15:00:23 -08:00
Tristan Ravitch
8e981b94bd Update the macaw and semmc submodules
The semmc submodule seemed to point to a non-existent commit.
2017-10-02 09:19:15 -07:00
Tristan Ravitch
b298b26355 Remove the macaw submodule (it moved) 2017-10-02 09:16:22 -07:00
Ben Selfridge
bf9b320e38 first commit 2017-08-28 15:48:55 -07:00