import sys
from nmutil.singlepipe import ControlBase
-from soc.simple.core_data import FetchOutput
+from soc.simple.core_data import FetchOutput, FetchInput
from nmigen.lib.coding import PriorityEncoder
class FetchFSM(ControlBase):
def __init__(self, allow_overlap, svp64_en, imem, core_rst,
pdecode2, cur_state,
- dbg, core, pc, svstate, nia, is_svp64_mode):
+ dbg, core, svstate, nia, is_svp64_mode):
self.allow_overlap = allow_overlap
self.svp64_en = svp64_en
self.imem = imem
self.cur_state = cur_state
self.dbg = dbg
self.core = core
- self.pc = pc
self.svstate = svstate
self.nia = nia
self.is_svp64_mode = is_svp64_mode
pass
def ispec(self):
- return Signal(name="dummy_for_now", reset_less=True)
+ return FetchInput()
def ospec(self):
return FetchOutput()
dbg = self.dbg
core = self.core,
- pc = self.pc
+ pc = self.i.pc
svstate = self.svstate
nia = self.nia
is_svp64_mode = self.is_svp64_mode
# set up Fetch FSM
fetch = FetchFSM(self.allow_overlap, self.svp64_en,
self.imem, core_rst, pdecode2, cur_state,
- dbg, core, pc, svstate, nia, is_svp64_mode)
+ dbg, core, svstate, nia, is_svp64_mode)
m.submodules.fetch = fetch
+ # connect up in/out data to existing Signals
+ comb += fetch.p.i_data.pc.eq(pc)
+ # and the ready/valid signalling
comb += fetch_pc_o_ready.eq(fetch.p.o_ready)
comb += fetch.p.i_valid.eq(fetch_pc_i_valid)
comb += fetch_insn_o_valid.eq(fetch.n.o_valid)