Skip to content

Commit

Permalink
core: Improve cmd_argument/command timings.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed May 13, 2024
1 parent 15bc2db commit df059bf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions litesdcard/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def __init__(self, phy):
# # #

# Register Mapping -------------------------------------------------------------------------
cmd_argument = self.cmd_argument.storage
cmd_command = self.cmd_command.storage
cmd_send = self.cmd_send.re
cmd_response = self.cmd_response.status
cmd_event = self.cmd_event.status
Expand All @@ -80,6 +78,8 @@ def __init__(self, phy):
cmd_error = Signal()
cmd_timeout = Signal()

cmd_argument = Signal(32)

data_type = Signal(2)
data_count = Signal(32)
data_done = Signal()
Expand All @@ -88,12 +88,14 @@ def __init__(self, phy):

cmd = Signal(6)

self.sync += [
# Decode type of Cmd/Data from Register (Sync for timings).
cmd_argument.eq( self.cmd_argument.storage),
cmd_type.eq( self.cmd_command.fields.cmd_type),
data_type.eq( self.cmd_command.fields.data_type),
cmd.eq( self.cmd_command.fields.cmd),
]
self.comb += [
# Decode type of Cmd/Data from Register.
cmd_type.eq(self.cmd_command.fields.cmd_type),
data_type.eq(self.cmd_command.fields.data_type),
cmd.eq(self.cmd_command.fields.cmd),

# Encode Cmd Event to Register.
self.cmd_event.fields.done.eq(cmd_done),
self.cmd_event.fields.error.eq(cmd_error),
Expand Down

0 comments on commit df059bf

Please sign in to comment.