diff options
| author | Kathy Gray | 2014-09-11 14:52:49 +0100 |
|---|---|---|
| committer | Kathy Gray | 2014-09-11 14:52:49 +0100 |
| commit | 9ba914479d792b673a90502fb55b0fa8a68202c7 (patch) | |
| tree | c062540a3654ca905e121efc4be94848ca88ebf7 /src/lem_interp | |
| parent | ce090e965026d58266a9b263be4d3b743f6fa2f3 (diff) | |
Adding support for extracting the information Christopher needs about an instruction
Diffstat (limited to 'src/lem_interp')
| -rw-r--r-- | src/lem_interp/instruction_extractor.lem | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lem_interp/instruction_extractor.lem b/src/lem_interp/instruction_extractor.lem new file mode 100644 index 00000000..6d8914c0 --- /dev/null +++ b/src/lem_interp/instruction_extractor.lem @@ -0,0 +1,25 @@ +open import Interp_ast +import Interp + +type typ = +| Bit +| Bitvector of maybe integer +| Other + +type instruction = +| Instr of string * list (string * typ) * list base_effect +| Skipped + +val extract_instructions : string -> string -> defs tannot -> list instruction + +let extract_from_decode decoder = [] + +let extract_effects instrs execute = instrs + +let extract_instructions decode_name execute_name defs = + let (Just decoder) = Interp.find_function defs (Id_aux (Id decode_name) Unknown) in + let (Just executer) = Interp.find_function defs (Id_aux (Id execute_name) Unknown) in + let instr_no_effects = extract_from_decode decoder in + let instructions = extract_effects instr_no_effects executer in + instructions + |
