From 284ce1c25dbe416019ecc546537bd96a66cebe37 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 24 Jun 2020 17:59:50 +0200 Subject: [PATCH] Fix CSR issue in PhaseInjector (r_data used for reading host data) --- gram/dfii.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/gram/dfii.py b/gram/dfii.py index 946913c..d495ad6 100644 --- a/gram/dfii.py +++ b/gram/dfii.py @@ -26,22 +26,20 @@ class PhaseInjector(Elaboratable): m = Module() m.d.comb += [ - self._phase.address.eq(self._address.r_data), - self._phase.bank.eq(self._baddress.r_data), - self._phase.wrdata_en.eq( - self._command_issue.r_stb & self._command.r_data[4]), - self._phase.rddata_en.eq( - self._command_issue.r_stb & self._command.r_data[5]), - self._phase.wrdata.eq(self._wrdata.r_data), + self._phase.address.eq(self._address.w_data), + self._phase.bank.eq(self._baddress.w_data), + self._phase.wrdata_en.eq(self._command_issue.w_stb & self._command.w_data[4]), + self._phase.rddata_en.eq(self._command_issue.w_stb & self._command.w_data[5]), + self._phase.wrdata.eq(self._wrdata.w_data), self._phase.wrdata_mask.eq(0) ] - with m.If(self._command_issue.r_stb): + with m.If(self._command_issue.w_stb): m.d.comb += [ - self._phase.cs_n.eq(Repl(value=~self._command.r_data[0], count=len(self._phase.cs_n))), - self._phase.we_n.eq(~self._command.r_data[1]), - self._phase.cas_n.eq(~self._command.r_data[2]), - self._phase.ras_n.eq(~self._command.r_data[3]), + self._phase.cs_n.eq(Repl(value=~self._command.w_data[0], count=len(self._phase.cs_n))), + self._phase.we_n.eq(~self._command.w_data[1]), + self._phase.cas_n.eq(~self._command.w_data[2]), + self._phase.ras_n.eq(~self._command.w_data[3]), ] with m.Else(): m.d.comb += [ -- 2.30.2