Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Minyong Li
Can
Commits
585b1228
Verified
Commit
585b1228
authored
Jul 11, 2021
by
Minyong Li
💬
Browse files
core.{Data,Program}Memory: add read enable signal
parent
6b278e2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/scala/uk/ac/soton/ecs/can/core/DataMemory.scala
View file @
585b1228
...
...
@@ -11,6 +11,7 @@ class DataMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule {
private
val
addrWidth
=
log2Ceil
(
cfg
.
dataMemoryWords
)
val
read
=
IO
(
new
Bundle
{
val
en
=
Input
(
Bool
())
val
addr
=
Input
(
UInt
(
addrWidth
.
W
))
val
data
=
Output
(
UInt
(
512.
W
))
})
...
...
@@ -26,7 +27,9 @@ class DataMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule {
else
Mem
(
cfg
.
dataMemoryWords
,
UInt
(
512.
W
))
read
.
data
:=
mem
(
read
.
addr
)
when
(
read
.
en
)
{
read
.
data
:=
mem
(
read
.
addr
)
}
when
(
write
.
en
)
{
mem
(
write
.
addr
)
:=
write
.
data
...
...
src/main/scala/uk/ac/soton/ecs/can/core/ProgramMemory.scala
View file @
585b1228
...
...
@@ -20,6 +20,7 @@ class ProgramMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule {
val
cw
=
IO
(
Output
(
UInt
(
cwWidth
.
W
)))
val
read
=
IO
(
new
Bundle
{
val
en
=
Input
(
Bool
())
val
addr
=
Input
(
UInt
(
addrWidth
.
W
))
val
data
=
Output
(
UInt
(
cwWidth
.
W
))
})
...
...
@@ -47,7 +48,9 @@ class ProgramMemory(implicit cfg: CanCoreConfiguration) extends MultiIOModule {
cw
:=
mem
(
pc
)
read
.
data
:=
mem
(
read
.
addr
)
when
(
read
.
en
)
{
read
.
data
:=
mem
(
read
.
addr
)
}
when
(
write
.
en
)
{
mem
(
write
.
addr
)
:=
write
.
data
...
...
Minyong Li
💬
@ml10g20
mentioned in commit
1325f446
·
Jul 15, 2021
mentioned in commit
1325f446
mentioned in commit 1325f446041f859bc0e1b0cefc91da8576365ce0
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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