Skip to content

Commit

Permalink
Migration to amaranth.lib.data (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
tilk authored Feb 3, 2024
1 parent 0a21082 commit 8ad6e12
Show file tree
Hide file tree
Showing 36 changed files with 396 additions and 319 deletions.
4 changes: 2 additions & 2 deletions constants/ecp5_platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def make_resources(pins: PinManager) -> list[Resource]:
number,
en=pins.p(),
done=pins.p(),
data_in=pins.p(adapter.data_in.shape().width),
data_out=pins.p(adapter.data_out.shape().width),
data_in=pins.p(adapter.data_in.shape().size),
data_out=pins.p(adapter.data_out.shape().size),
)
]

Expand Down
2 changes: 1 addition & 1 deletion coreblocks/fu/fu_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Decoder(Elaboratable):
def __init__(self, gen_params: GenParams, decode_fn: Type[IntFlag], ops: Sequence[tuple], check_optype: bool):
layouts = gen_params.get(CommonLayoutFields)

self.exec_fn = Record(layouts.exec_fn_layout)
self.exec_fn = Signal(layouts.exec_fn_layout)
self.decode_fn = Signal(decode_fn)
self.ops = ops
self.check_optype = check_optype
Expand Down
4 changes: 2 additions & 2 deletions coreblocks/fu/mul_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ def get_instructions(self) -> Sequence[tuple]:
]


def get_input(arg: Record) -> tuple[Value, Value]:
def get_input(arg: MethodStruct) -> tuple[Value, Value]:
"""
Operation of getting two input values.
Parameters
----------
arg: Record
arg: MethodStruct
Arguments of functional unit issue call.
Returns
Expand Down
5 changes: 3 additions & 2 deletions coreblocks/lsu/dummyLsu.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from amaranth import *
from amaranth.lib.data import View

from transactron import Method, def_method, Transaction, TModule
from coreblocks.params import *
Expand Down Expand Up @@ -220,7 +221,7 @@ def elaborate(self, platform):
precommiting = Signal() # start execution
issued = Signal() # instruction was issued to the bus
flush = Signal() # exception handling, requests are not issued
current_instr = Record(self.lsu_layouts.rs.data_layout)
current_instr = Signal(self.lsu_layouts.rs.data_layout)

m.submodules.pma_checker = pma_checker = PMAChecker(self.gen_params)
m.submodules.requester = requester = LSURequester(self.gen_params, self.bus)
Expand Down Expand Up @@ -248,7 +249,7 @@ def _():
return {"rs_entry_id": 0}

@def_method(m, self.insert)
def _(rs_data: Record, rs_entry_id: Value):
def _(rs_data: View, rs_entry_id: Value):
m.d.sync += assign(current_instr, rs_data)
m.d.sync += valid.eq(1)

Expand Down
Loading

0 comments on commit 8ad6e12

Please sign in to comment.