| // Copyright 2024 Google LLC | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // https://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| // This file defines the push and pop instructions for a test ISA to test | |
| // "array" or "list" operands. | |
| decoder PushPopInst { | |
| namespace mpact::sim::decoder::test; | |
| opcode_enum = "OpcodeEnum"; | |
| includes { | |
| #include "mpact/sim/decoder/test/push_pop_inst_decoder.h" | |
| } | |
| PushPop; | |
| } | |
| format Inst16Format[16] { | |
| fields: | |
| unsigned func3[3]; | |
| unsigned bits[11]; | |
| unsigned op[2]; | |
| } | |
| format PType[16] : Inst16Format { | |
| fields: | |
| unsigned func8[8]; | |
| unsigned rlist[4]; | |
| unsigned spimm[2]; | |
| unsigned op[2]; | |
| overlays: | |
| unsigned spimm6[6] = spimm, 0b0000; | |
| } | |
| instruction group PushPop[16] : Inst16Format { | |
| push : PType : func8 == 0b101'11000, rlist > 3, op == 0b10; | |
| pop : PType : func8 == 0b101'11010, rlist > 3, op == 0b10; | |
| } |