Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393
Commits
865a8cef
Commit
865a8cef
authored
Aug 26, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correcting command sequencer
parent
3499bbe7
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
35 deletions
+80
-35
cmd_frame_sequencer.v
util_modules/cmd_frame_sequencer.v
+70
-31
cmd_seq_mux.v
util_modules/cmd_seq_mux.v
+10
-4
No files found.
util_modules/cmd_frame_sequencer.v
View file @
865a8cef
This diff is collapsed.
Click to expand it.
util_modules/cmd_seq_mux.v
View file @
865a8cef
...
@@ -92,10 +92,13 @@ module cmd_seq_mux#(
...
@@ -92,10 +92,13 @@ module cmd_seq_mux#(
output
reg
[
31
:
0
]
wdata_out
,
// write data, valid with waddr_out and wr_en_out
output
reg
[
31
:
0
]
wdata_out
,
// write data, valid with waddr_out and wr_en_out
input
ackn_out
// command sequencer address/data accepted
input
ackn_out
// command sequencer address/data accepted
)
;
)
;
wire
[
3
:
0
]
wr_en
=
{
wr_en3
&
~
ackn3
,
wr_en2
&
~
ackn2
,
wr_en1
&
~
ackn1
,
wr_en0
&
~
ackn0
};
wire
[
3
:
0
]
wr_rq
=
{
wr_en3
,
wr_en2
,
wr_en1
,
wr_en0
};
// wire [3:0] wr_en = {wr_en3 & ~ackn3, wr_en2 & ~ackn2, wr_en1 & ~ackn1, wr_en0 & ~ackn0};
wire
[
3
:
0
]
wr_en
=
wr_rq
&
~
ackn_r
;
// write enable antil acknowledged?
//ackn_r
wire
[
15
:
0
]
pri_one_rr
;
// round robin priority
wire
[
15
:
0
]
pri_one_rr
;
// round robin priority
wire
[
3
:
0
]
pri_one
;
wire
[
3
:
0
]
pri_one
;
reg
[
1
:
0
]
chn_r
;
// last served channel
reg
[
1
:
0
]
chn_r
=
0
;
// last served channel
wire
rq_any
;
wire
rq_any
;
wire
[
1
:
0
]
pri_enc_w
;
wire
[
1
:
0
]
pri_enc_w
;
reg
full_r
;
reg
full_r
;
...
@@ -112,7 +115,8 @@ module cmd_seq_mux#(
...
@@ -112,7 +115,8 @@ module cmd_seq_mux#(
assign
pri_one
=
pri_one_rr
[
chn_r
*
4
+:
4
]
;
assign
pri_one
=
pri_one_rr
[
chn_r
*
4
+:
4
]
;
assign
rq_any
=
|
wr_en
;
assign
rq_any
=
|
wr_en
;
// Loop?
// assign rq_any= |wr_rq;
assign
pri_enc_w
={
pri_one
[
3
]
|
pri_one
[
2
]
,
assign
pri_enc_w
={
pri_one
[
3
]
|
pri_one
[
2
]
,
pri_one
[
3
]
|
pri_one
[
1
]
};
pri_one
[
3
]
|
pri_one
[
1
]
};
assign
wr_en_out
=
full_r
;
assign
wr_en_out
=
full_r
;
...
@@ -133,8 +137,10 @@ module cmd_seq_mux#(
...
@@ -133,8 +137,10 @@ module cmd_seq_mux#(
always
@
(
posedge
mclk
)
begin
always
@
(
posedge
mclk
)
begin
if
(
mrst
)
chn_r
<=
0
;
// let it always start from 0
else
if
(
ackn_w
)
chn_r
<=
pri_enc_w
;
if
(
ackn_w
)
begin
if
(
ackn_w
)
begin
chn_r
<=
pri_enc_w
;
case
(
pri_enc_w
)
case
(
pri_enc_w
)
2'h0
:
begin
2'h0
:
begin
waddr_out
<=
waddr0
;
waddr_out
<=
waddr0
;
...
...
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