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
e8e1cf67
Commit
e8e1cf67
authored
Oct 11, 2017
by
Jens Korinth
Browse files
Implement generators for ScalaCheck for AXI configurations
parent
7fa3b107
Changes
3
Show whitespace changes
Inline
Side-by-side
src/test/scala/axi/generators.scala
0 → 100644
View file @
e8e1cf67
package
chisel.axi.axi4
import
chisel.axi.generators._
import
org.scalacheck.
{
Arbitrary
,
Gen
}
package
object
generators
{
object
Axi4
{
val
configurationGen
:
Gen
[
chisel.axi.Axi4.Configuration
]
=
for
{
addrWidth
<-
addrWidthGen
dataWidth
<-
dataWidthGen
userWidth
<-
userWidthGen
idWidth
<-
idWidthGen
regionWidth
<-
regionWidthGen
hasQoS
<-
Arbitrary
.
arbBool
.
arbitrary
}
yield
chisel
.
axi
.
Axi4
.
Configuration
(
addrWidth
,
dataWidth
,
idWidth
,
userWidth
,
regionWidth
,
hasQoS
)
}
object
Axi4Lite
{
val
dataWidthGen
:
Gen
[
chisel.axi.Axi4Lite.DataWidth
]
=
Gen
.
oneOf
(
chisel
.
axi
.
Axi4Lite
.
Width32
,
chisel
.
axi
.
Axi4Lite
.
Width64
)
val
configurationGen
:
Gen
[
chisel.axi.Axi4Lite.Configuration
]
=
for
{
addrWidth
<-
addrWidthGen
dataWidth
<-
dataWidthGen
userWidth
<-
userWidthGen
regionWidth
<-
regionWidthGen
}
yield
chisel
.
axi
.
Axi4Lite
.
Configuration
(
addrWidth
,
dataWidth
,
userWidth
,
regionWidth
)
}
}
src/test/scala/axi4lite/generators.scala
0 → 100644
View file @
e8e1cf67
package
chisel.axiutils.axi4lite
import
chisel.axiutils.generators._
package
object
generators
{
}
src/test/scala/generators.scala
0 → 100644
View file @
e8e1cf67
package
chisel.axi
import
chisel.miscutils.generators._
import
org.scalacheck._
package
object
generators
{
val
addrWidthGen
:
Gen
[
AddrWidth
]
=
genLimited
(
1
,
64
)
map
(
AddrWidth
(
_
))
val
dataWidthGen
:
Gen
[
DataWidth
]
=
genLimited
(
1
,
4096
)
map
(
DataWidth
(
_
))
val
userWidthGen
:
Gen
[
UserWidth
]
=
Gen
.
frequency
(
90
->
UserWidth
(
0
),
10
->
(
genLimited
(
1
,
15
)
map
(
UserWidth
(
_
)))
)
val
idWidthGen
:
Gen
[
IdWidth
]
=
genLimited
(
0
,
15
)
map
(
IdWidth
(
_
))
val
regionWidthGen
:
Gen
[
RegionWidth
]
=
genLimited
(
0
,
4
)
map
(
RegionWidth
(
_
))
}
Jens Korinth
@jk
mentioned in commit
17f0d672
·
Mar 05, 2018
mentioned in commit
17f0d672
mentioned in commit 17f0d67240ebf5d7e1d0be9162d272b04256c47d
Toggle commit list
Write
Preview
Supports
Markdown
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