Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
NanoSoC Tech
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
NanoSoC Tech
Commits
23d548a2
Commit
23d548a2
authored
2 years ago
by
dwf1m12
Browse files
Options
Downloads
Patches
Plain Diff
update ADP v4 to add B (byte) and H (half) to R (word) read commands
parent
e2bd15bc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
system/test_io/verilog/nanosoc_adp_manager.v
+24
-5
24 additions, 5 deletions
system/test_io/verilog/nanosoc_adp_manager.v
system/testcodes/adp_demo/adp.cmd
+2
-2
2 additions, 2 deletions
system/testcodes/adp_demo/adp.cmd
with
26 additions
and
7 deletions
system/test_io/verilog/nanosoc_adp_manager.v
+
24
−
5
View file @
23d548a2
...
...
@@ -12,7 +12,7 @@
//`define ADPBASIC 1
`define
ADPFSMDESIGN 1
//
`define ADPFSMDESIGN 1
module
nanosoc_adp_manager
// AHB initiator interface
#(
parameter
PROMPT_CHAR
=
"]"
...
...
@@ -77,6 +77,8 @@ localparam CMD_M = 4'b1001; // set read Mask
localparam
CMD_P
=
4'b1010
;
// Poll hardware (count)
localparam
CMD_U
=
4'b1011
;
// (Binary) Upload (wordocunt) from addr++
localparam
CMD_V
=
4'b1100
;
// match Value
localparam
CMD_B
=
4'b1101
;
// Read byte, addr++
localparam
CMD_H
=
4'b1110
;
// Read Halfword, addr++
`endif
...
...
@@ -111,6 +113,10 @@ case (char8[7:0])
"u"
:
FNvalid_cmd
=
CMD_U
;
"V"
:
FNvalid_cmd
=
CMD_V
;
"v"
:
FNvalid_cmd
=
CMD_V
;
"B"
:
FNvalid_cmd
=
CMD_B
;
"b"
:
FNvalid_cmd
=
CMD_B
;
"H"
:
FNvalid_cmd
=
CMD_H
;
"h"
:
FNvalid_cmd
=
CMD_H
;
`endif
default:
FNvalid_cmd
=
0
;
...
...
@@ -571,11 +577,22 @@ always @(posedge HCLK or negedge HRESETn)
begin
adp_state
<=
ADP_SYSCTL
;
end
end
else
if
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_R
)
begin
adp_size
<=
FNparam2size
(
adp_param
[
34
:
33
])
;
ADP_BUSREADINC_next
;
adp_state
<=
ADP_READ
;
begin
adp_size
<=
2'b10
;
ADP_BUSREADINC_next
;
adp_state
<=
ADP_READ
;
`ifndef
ADPBASIC
adp_count_dec
<=
1'b1
;
// optional loop param
`endif
end
// no param required
end
// param is optional count-down loop
`ifndef
ADPBASIC
else
if
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_H
)
begin
adp_size
<=
2'b01
;
ADP_BUSREADINC_next
;
adp_state
<=
ADP_READ
;
adp_count_dec
<=
1'b1
;
// optional loop param
end
// param is optional count-down loop
else
if
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_B
)
begin
adp_size
<=
2'b00
;
ADP_BUSREADINC_next
;
adp_state
<=
ADP_READ
;
adp_count_dec
<=
1'b1
;
// optional loop param
end
// param is optional count-down loop
`endif
else
if
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_S
)
begin
adp_state
<=
ADP_SYSCHK
;
end
else
if
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_W
)
...
...
@@ -611,7 +628,7 @@ always @(posedge HCLK or negedge HRESETn)
:
(
byteaddr
[
1
:
0
]
==
2'b10
)
?
{
HRDATA32_i
[
15
:
0
],
HRDATA32_i
[
31
:
16
]
}
:
(
byteaddr
[
1
:
0
]
==
2'b11
)
?
{
HRDATA32_i
[
23
:
0
],
HRDATA32_i
[
31
:
24
]
}
:
HRDATA32_i
;
adp_bus_err
<=
HRESP_i
;
ADP_txchar_next
(
"R"
);
adp_state
<=
ADP_ECHOBUS
;
adp_bus_err
<=
HRESP_i
;
ADP_txchar_next
(
adp_cmd
&
8'h5f
);
adp_state
<=
ADP_ECHOBUS
;
end
else
begin
ADP_BUSREADINC_next
;
...
...
@@ -732,7 +749,9 @@ always @(posedge HCLK or negedge HRESETn)
if
(
com_tx_done
)
begin
if
(
banner
)
begin
banner
<=
0
;
adp_state
<=
STD_IOCHK
;
end
`ifndef
ADPBASIC
else
if
((
FNvalid_cmd
(
adp_cmd
)
==
CMD_R
)
&
|
adp_count
)
//// non-zero count
else
if
(
((
FNvalid_cmd
(
adp_cmd
)
==
CMD_R
)
|
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_H
)
|
(
FNvalid_cmd
(
adp_cmd
)
==
CMD_B
))
&
|
adp_count
)
//// non-zero count
begin
ADP_BUSREADINC_next
;
adp_count_dec
<=
1'b1
;
adp_state
<=
ADP_READ
;
end
//
`endif
else
begin
ADP_txchar_next
(
PROMPT_CHAR
);
adp_state
<=
ADP_PROMPT
;
end
...
...
This diff is collapsed.
Click to expand it.
system/testcodes/adp_demo/adp.cmd
+
2
−
2
View file @
23d548a2
...
...
@@ -33,11 +33,11 @@ w 0xb7b6b5b4
a
a
0x80000000
a
r
0x8
b
0x8
a
a
0x80000000
a
r
0x004
h
0x004
a
a
0x80000000
a
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment