Skip to content

Commit

Permalink
asmi: dat_wm high to disable data write
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed May 15, 2012
1 parent f2c20e4 commit 0bea1e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ The data signals are used to complete requests.
* Master-to-Hub * Master-to-Hub


* ``data_w`` must supply data to the controller from the appropriate write transaction, on the cycle after they have been called using ``call`` and ``tag_call``. * ``data_w`` must supply data to the controller from the appropriate write transaction, on the cycle after they have been called using ``call`` and ``tag_call``.
* ``data_wm`` are the byte-granular write data masks. They are used in combination with ``data_w`` to identify the bytes that should be modified in the memory. The ``data_wm`` bit should be high for its corresponding ``data_w`` byte to be written. * ``data_wm`` are the byte-granular write data masks. They are used in combination with ``data_w`` to identify the bytes that should be modified in the memory. The ``data_wm`` bit should be low for its corresponding ``data_w`` byte to be written.


In order to avoid duplicating the tag matching and tracking logic, the master-to-hub data signals must be driven low when they are not in use, so that they can be simply ORed together inside the memory controller. This way, only masters have to track (their own) transactions for arbitrating the data lines. In order to avoid duplicating the tag matching and tracking logic, the master-to-hub data signals must be driven low when they are not in use, so that they can be simply ORed together inside the memory controller. This way, only masters have to track (their own) transactions for arbitrating the data lines.


Expand Down
2 changes: 1 addition & 1 deletion migen/bus/asmibus.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _execute(self, s, port, generator):
yield yield
if isinstance(transaction, TWrite): if isinstance(transaction, TWrite):
s.wr(port.dat_w, transaction.data) s.wr(port.dat_w, transaction.data)
s.wr(port.dat_wm, transaction.sel) s.wr(port.dat_wm, ~transaction.sel)
yield yield
s.wr(port.dat_w, 0) s.wr(port.dat_w, 0)
s.wr(port.dat_wm, 0) s.wr(port.dat_wm, 0)
Expand Down
6 changes: 2 additions & 4 deletions migen/bus/wishbone2asmi.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ def get_fragment(self):
displacer(self.wishbone.sel, adr_offset, data_we, 2**offsetbits, reverse=True) displacer(self.wishbone.sel, adr_offset, data_we, 2**offsetbits, reverse=True)
) )
), ),
If(write_to_asmi, If(write_to_asmi, self.asmiport.dat_w.eq(data_do)),
self.asmiport.dat_w.eq(data_do), self.asmiport.dat_wm.eq(0),
self.asmiport.dat_wm.eq(Replicate(1, adw//8))
),
chooser(data_do, adr_offset_r, self.wishbone.dat_r, reverse=True) chooser(data_do, adr_offset_r, self.wishbone.dat_r, reverse=True)
] ]
sync += [ sync += [
Expand Down

0 comments on commit 0bea1e2

Please sign in to comment.