Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
70928314
Commit
70928314
authored
Dec 29, 2017
by
Jens Korinth
Browse files
Add restart input to ProgrammableMaster
* while high, won't execute any actions, but reset its step counter
parent
0b91c23a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/axi4lite/ProgrammableMaster.scala
View file @
70928314
...
...
@@ -35,6 +35,7 @@ final case class MasterWrite(address: Int, v: BigInt) extends MasterAction {
val
w_resp
=
Decoupled
(
new
chisel
.
axi
.
Axi4Lite
.
WriteResponse
)
val
finished
=
Output
(
Bool
())
val
start
=
Input
(
UInt
(
if
(
startable
)
1.
W
else
0.
W
))
val
restart
=
Input
(
Bool
())
})
val
cnt
=
RegInit
(
UInt
(
log2Ceil
(
action
.
length
+
1
).
W
),
init
=
0.
U
)
...
...
@@ -77,20 +78,26 @@ final case class MasterWrite(address: Int, v: BigInt) extends MasterAction {
when
(
io
.
maxi
.
writeData
.
fire
)
{
wd_valid
:=
false
.
B
}
when
(
io
.
maxi
.
writeResp
.
fire
)
{
wr_ready
:=
false
.
B
}
when
((
if
(
startable
)
RegNext
(
io
.
start
(
0
),
init
=
false
.
B
)
else
true
.
B
))
{
when
(!
signals
.
reduce
(
_
||
_
))
{
for
(
i
<-
0
until
action
.
length
)
{
when
(
i
.
U
===
cnt
)
{
//info(s"Starting action #$i: ${action(i)}")
ra
:=
action
(
i
).
address
.
U
wa
:=
action
(
i
).
address
.
U
wd
:=
action
(
i
).
value
.
getOrElse
(
BigInt
(
0
)).
U
ra_valid
:=
action
(
i
).
isRead
.
B
rd_ready
:=
action
(
i
).
isRead
.
B
wa_valid
:=
(!
action
(
i
).
isRead
).
B
wd_valid
:=
(!
action
(
i
).
isRead
).
B
wr_ready
:=
(!
action
(
i
).
isRead
).
B
cnt
:=
cnt
+
1.
U
when
(
RegNext
(
io
.
restart
))
{
info
(
"restarting action sequence ..."
)
cnt
:=
0.
U
}
.
otherwise
{
when
((
if
(
startable
)
RegNext
(
io
.
start
(
0
),
init
=
false
.
B
)
else
true
.
B
))
{
when
(!
signals
.
reduce
(
_
||
_
))
{
for
(
i
<-
0
until
action
.
length
)
{
when
(
i
.
U
===
cnt
)
{
//info(s"Starting action #$i: ${action(i)}")
ra
:=
action
(
i
).
address
.
U
wa
:=
action
(
i
).
address
.
U
wd
:=
action
(
i
).
value
.
getOrElse
(
BigInt
(
0
)).
U
ra_valid
:=
action
(
i
).
isRead
.
B
rd_ready
:=
action
(
i
).
isRead
.
B
wa_valid
:=
(!
action
(
i
).
isRead
).
B
wd_valid
:=
(!
action
(
i
).
isRead
).
B
wr_ready
:=
(!
action
(
i
).
isRead
).
B
cnt
:=
cnt
+
1.
U
}
}
}
}
...
...
Jens Korinth
@jk
mentioned in commit
17f0d672
·
Mar 05, 2018
mentioned in commit
17f0d672
mentioned in commit 17f0d67240ebf5d7e1d0be9162d272b04256c47d
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment