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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
NanoSoC Tech
Commits
d64e49d5
Commit
d64e49d5
authored
1 year ago
by
Daniel Newbrook
Browse files
Options
Downloads
Patches
Plain Diff
Update DMA350_tests interrupts still not working
parent
1f091d5e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Feat dma350 merge into main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nanosoc/nanosoc_subsystems/dma/verilog/nanosoc_ss_dma.v
+5
-5
5 additions, 5 deletions
nanosoc/nanosoc_subsystems/dma/verilog/nanosoc_ss_dma.v
software/common/validation/dma350_tests.c
+80
-43
80 additions, 43 deletions
software/common/validation/dma350_tests.c
with
85 additions
and
48 deletions
nanosoc/nanosoc_subsystems/dma/verilog/nanosoc_ss_dma.v
+
5
−
5
View file @
d64e49d5
...
...
@@ -124,8 +124,8 @@ module nanosoc_ss_dma #(
assign
DMAC_1_PSEL_IN
=
DMAC_1_PSEL
|
DMAC_1_PSEL_HI
;
// DMA Status Tie-off signals
assign
DMAC_
0
_DMA_DONE
=
{
DMAC_0_CHANNEL_NUM
{
1'b0
}}
;
assign
DMAC_
0
_DMA_ERR
=
1'b0
;
assign
DMAC_
1
_DMA_DONE
=
{
DMAC_0_CHANNEL_NUM
{
1'b0
}}
;
assign
DMAC_
1
_DMA_ERR
=
1'b0
;
sldma350_ahb
#(
.
SYS_ADDR_W
(
SYS_ADDR_W
),
...
...
@@ -174,9 +174,9 @@ module nanosoc_ss_dma #(
.
PREADY
(
DMAC_1_PREADY
),
.
PSLVERR
(
DMAC_1_PSLVERR
),
// DMA Request and Status Port
.
DMA_REQ
(
DMAC_
1
_DMA_REQ
),
.
DMA_DONE
(
DMAC_
1
_DMA_DONE
),
.
DMA_ERR
(
DMAC_
1
_DMA_ERR
),
.
DMA_REQ
(
DMAC_
0
_DMA_REQ
),
.
DMA_DONE
(
DMAC_
0
_DMA_DONE
),
.
DMA_ERR
(
DMAC_
0
_DMA_ERR
),
.
DMAC_STR_OUT_0_TVALID
(
DMAC_STR_OUT_0_TVALID
),
.
DMAC_STR_OUT_0_TREADY
(
DMAC_STR_OUT_0_TREADY
),
...
...
This diff is collapsed.
Click to expand it.
software/common/validation/dma350_tests.c
+
80
−
43
View file @
d64e49d5
#include
"CMSDK_CM0.h"
#include
<stdio.h>
#include
"uart_stdout.h"
#include
"CMSDK_driver.h"
#include
"config_id.h"
#include
<string.h>
...
...
@@ -28,14 +30,6 @@
#define DATA_SIZE 256
#define LARGE_DATA_SIZE 10000
// Note: Please modify to the desired boot settings
#define DMA_BOOT_ADDR 0x10000000
// Privileged mode enabled and disabled
// Note: Please modify according to your system
#define EnablePrivilegedMode() __asm("SVC #0")
#define DisablePrivilegedMode() __asm("SVC #1")
#define HW32_REG(ADDRESS) (*((volatile unsigned long *)(ADDRESS)))
#if defined ( __CC_ARM )
...
...
@@ -221,7 +215,7 @@ int main(void) {
AdaTrigInType
command_trig_in
=
{
.
USETRIGIN
=
1
,
.
TRIGINSEL
=
0
,
.
TRIGINTYPE
=
TRIGTYPE_
H
W_
EXTERNAL
,
.
TRIGINTYPE
=
TRIGTYPE_
S
W_
ONLY
,
.
TRIGINMODE
=
TRIGINMODE_CMD
,
.
TRIGINBLKSIZE
=
0
};
...
...
@@ -293,40 +287,7 @@ int main(void) {
printf
(
"Number of DMA channels: %d
\n
"
,
ch_num
);
printf
(
"Number of DMA trigger inputs: %d
\n
"
,
trig_in_num
);
printf
(
"Number of DMA trigger outputs: %d
\n
"
,
trig_out_num
);
printf
(
"---STARTING 1D Command Tests With interrupts---
\n
"
);
printf
(
"Test BURST with 1D basic commands from COPY_ADDR_SRC to COPY_ADDR_DST...
\n
"
);
for
(
uint32_t
ch
=
0
;
ch
<
ch_num
;
ch
++
)
{
//
// Write all settings to the DMA registers
AdaChannelInit
(
ch_settings
,
ch_srcattr
,
ch_desattr
,
ch
,
SECURE
);
Ada1DIncrCommand
(
command_base
,
command_1d_incr
,
ch
,
SECURE
);
SetAdaWrapRegs
(
command_1d_wrap
,
ch
,
SECURE
);
AdaSetIntEn
(
ch_irqs
,
ch
,
SECURE
);
dma_done_irq_expected
=
1
;
dma_done_irq_occurred
=
0
;
NVIC_ClearPendingIRQ
(
DMA_IRQn
);
NVIC_EnableIRQ
(
DMA_IRQn
);
printf
(
"DMA %d configured. Starting the transfer.
\n
"
,
ch
);
// Start DMA operation and wait for done IRQ
AdaEnable
(
ch
,
SECURE
);
delay
(
256
);
printf
(
"DMA Interrupt Handled
\n
"
);
uint8_t
ch_enabled
=
1
;
while
(
ch_enabled
==
1
)
{
ch_enabled
=
AdaGetEnable
(
ch
,
SECURE
);
}
printf
(
"DMA transfer finished
\n
"
);
}
NVIC_DisableIRQ
(
DMA_IRQn
);
__disable_irq
();
printf
(
"---STARTING 1D Command Tests No interrupts---
\n
"
);
// **********************************************************************************************
...
...
@@ -423,7 +384,82 @@ int main(void) {
printf
(
"DMA transfer finished
\n
"
);
}
printf
(
"Test Software Trigger interface
\n
"
);
for
(
uint32_t
ch
=
0
;
ch
<
ch_num
;
ch
++
)
{
//
// Write all settings to the DMA registers
AdaChannelInit
(
ch_settings_no_burst
,
ch_srcattr
,
ch_desattr
,
ch
,
SECURE
);
Ada1DIncrCommand
(
command_base
,
command_1d_incr
,
ch
,
SECURE
);
SetAdaWrapRegs
(
command_1d_wrap
,
ch
,
SECURE
);
AdaDesTrigInInit
(
command_trig_in
,
CH0
,
SECURE
);
printf
(
"DMA %d configured. Starting the transfer.
\n
"
,
ch
);
// Start DMA operation and wait for done IRQ
AdaEnable
(
ch
,
SECURE
);
AdaDesTrigInEnable
(
1
,
ch
,
SECURE
);
AdaDesSwTrigInReq
(
BLOCK
,
ch
,
SECURE
);
uint8_t
timeout
=
0
;
uint8_t
i
=
0
;
uint8_t
ch_enabled
=
1
;
while
(
ch_enabled
==
1
&&
timeout
==
0
)
{
ch_enabled
=
AdaGetEnable
(
ch
,
SECURE
);
i
++
;
if
(
i
>
512
){
timeout
=
1
;
}
}
if
(
timeout
==
1
){
printf
(
"DMA Timeout occured"
);
AdaStatType
DMA_status
=
AdaReadStatus
(
ch
,
SECURE
);
printf
(
"DMA STAT_DONE: %d
\n
"
,
DMA_status
.
STAT_DONE
);
printf
(
"DMA STAT_ERR: %d
\n
"
,
DMA_status
.
STAT_ERR
);
printf
(
"DMA STAT_DISABLED: %d
\n
"
,
DMA_status
.
STAT_DISABLED
);
printf
(
"DMA STAT_PAUSED: %d
\n
"
,
DMA_status
.
STAT_PAUSED
);
printf
(
"DMA STAT_RESUMEWAIT: %d
\n
"
,
DMA_status
.
STAT_RESUMEWAIT
);
}
printf
(
"DMA transfer finished
\n
"
);
}
printf
(
"---STARTING 1D Command Tests With interrupts---
\n
"
);
__enable_irq
();
printf
(
"Test BURST with 1D basic commands from COPY_ADDR_SRC to COPY_ADDR_DST...
\n
"
);
for
(
uint32_t
ch
=
0
;
ch
<
ch_num
;
ch
++
)
{
//
// Write all settings to the DMA registers
AdaChannelInit
(
ch_settings
,
ch_srcattr
,
ch_desattr
,
ch
,
SECURE
);
Ada1DIncrCommand
(
command_base
,
command_1d_incr
,
ch
,
SECURE
);
SetAdaWrapRegs
(
command_1d_wrap
,
ch
,
SECURE
);
AdaSetIntEn
(
ch_irqs
,
ch
,
SECURE
);
dma_done_irq_expected
=
1
;
dma_done_irq_occurred
=
0
;
NVIC_ClearPendingIRQ
(
DMA_IRQn
);
NVIC_EnableIRQ
(
DMA_IRQn
);
printf
(
"DMA %d configured. Starting the transfer.
\n
"
,
ch
);
// Start DMA operation and wait for done IRQ
AdaEnable
(
ch
,
SECURE
);
printf
(
"debug
\n
"
);
while
(
dma_done_irq_occurred
==
0
){
__WFE
();
}
printf
(
"DMA Interrupt Handled
\n
"
);
uint8_t
ch_enabled
=
1
;
while
(
ch_enabled
==
1
)
{
ch_enabled
=
AdaGetEnable
(
ch
,
SECURE
);
}
printf
(
"DMA transfer finished
\n
"
);
}
NVIC_DisableIRQ
(
DMA_IRQn
);
UartEndSimulation
();
return
0
;
}
...
...
@@ -504,6 +540,7 @@ void DMAClearChIrq(uint32_t ch) {
void
DMA_Handler
(
void
){
__disable_irq
();
printf
(
"DMA Interrupted
\n
"
);
dma_done_irq_occurred
++
;
DMAClearChIrq
(
0
);
DMAClearChIrq
(
1
);
__enable_irq
();
...
...
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