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
c74b8a56
Commit
c74b8a56
authored
Dec 11, 2017
by
Jens Korinth
Browse files
Implement wire defaults for Axi4Lite sub-bundles
parent
ee598c83
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/axi/Axi4Lite.scala
View file @
c74b8a56
...
...
@@ -20,6 +20,13 @@ object Axi4Lite {
val
region
=
UInt
(
cfg
.
regionWidth
)
val
user
=
UInt
(
cfg
.
userWidth
)
def
defaults
{
addr
:=
"h12345678"
.
U
prot
.
prot
:=
Protection
(
Protection
.
Flag
.
NON_PRIVILEGED
,
Protection
.
Flag
.
NON_SECURE
,
Protection
.
Flag
.
DATA
).
U
region
:=
0.
U
user
:=
0.
U
}
override
def
cloneType
=
{
new
Address
()(
cfg
).
asInstanceOf
[
this.
type
]
}
}
...
...
@@ -27,17 +34,32 @@ object Axi4Lite {
abstract
private
[
axi
]
class
DataChannel
(
implicit
cfg
:
Configuration
)
extends
Bundle
{
val
data
=
UInt
(
cfg
.
dataWidth
)
val
user
=
UInt
(
cfg
.
userWidth
)
def
defaults
{
data
:=
"hDEADBEEF"
.
U
user
:=
"hDEADDEED"
.
U
}
}
class
Read
(
implicit
cfg
:
Configuration
)
extends
DataChannel
{
val
resp
=
UInt
(
2.
W
)
override
def
defaults
{
super
.
defaults
resp
:=
Response
.
slverr
}
override
def
cloneType
=
{
new
Read
()(
cfg
).
asInstanceOf
[
this.
type
]
}
}
class
Write
(
implicit
cfg
:
Configuration
)
extends
DataChannel
{
val
strb
=
new
Strobe
(
cfg
.
dataWidth
)
override
def
defaults
{
super
.
defaults
strb
.
strb
:=
Strobe
(
0
until
cfg
.
dataWidth
/
8
:_
*
)
}
override
def
cloneType
=
{
new
Write
()(
cfg
).
asInstanceOf
[
this.
type
]
}
}
}
...
...
@@ -46,6 +68,11 @@ object Axi4Lite {
val
buser
=
UInt
(
cfg
.
userWidth
)
val
bresp
=
UInt
(
2.
W
)
def
defaults
{
buser
:=
0.
U
bresp
:=
Response
.
slverr
}
override
def
cloneType
=
{
new
WriteResponse
()(
cfg
).
asInstanceOf
[
this.
type
]
}
}
...
...
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