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
ad509803
Commit
ad509803
authored
1 year ago
by
Daniel Newbrook
Browse files
Options
Downloads
Patches
Plain Diff
Testing Interrupt Not yet working
parent
c2b315e0
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2
Feat dma350 merge into main
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
nanosoc/nanosoc_subsystems/dma/verilog/nanosoc_ss_dma.v
+6
-0
6 additions, 0 deletions
nanosoc/nanosoc_subsystems/dma/verilog/nanosoc_ss_dma.v
software/common/validation/dma350_tests.c
+51
-1
51 additions, 1 deletion
software/common/validation/dma350_tests.c
with
57 additions
and
1 deletion
nanosoc/nanosoc_subsystems/dma/verilog/nanosoc_ss_dma.v
+
6
−
0
View file @
ad509803
...
@@ -119,8 +119,14 @@ module nanosoc_ss_dma #(
...
@@ -119,8 +119,14 @@ module nanosoc_ss_dma #(
//-------------------------------
//-------------------------------
//DMA Controller 0 Instantiation
//DMA Controller 0 Instantiation
//-------------------------------
//-------------------------------
wire
DMAC_1_PSEL_IN
;
wire
DMAC_1_PSEL_IN
;
assign
DMAC_1_PSEL_IN
=
DMAC_1_PSEL
|
DMAC_1_PSEL_HI
;
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
;
sldma350_ahb
#(
sldma350_ahb
#(
.
SYS_ADDR_W
(
SYS_ADDR_W
),
.
SYS_ADDR_W
(
SYS_ADDR_W
),
.
SYS_DATA_W
(
SYS_DATA_W
),
.
SYS_DATA_W
(
SYS_DATA_W
),
...
...
This diff is collapsed.
Click to expand it.
software/common/validation/dma350_tests.c
+
51
−
1
View file @
ad509803
...
@@ -52,6 +52,12 @@ uint32_t LinkCmd[6];
...
@@ -52,6 +52,12 @@ uint32_t LinkCmd[6];
// Variable to store the address of the above array
// Variable to store the address of the above array
uintptr_t
LinkCmd_adr
=
(
uintptr_t
)
LinkCmd
;
uintptr_t
LinkCmd_adr
=
(
uintptr_t
)
LinkCmd
;
volatile
int
dma_done_irq_occurred
;
volatile
int
dma_done_irq_expected
;
volatile
int
dma_error_irq_occurred
;
volatile
int
dma_error_irq_expected
;
void
delay
(
void
);
void
SystemInitialization
(
void
);
void
SystemInitialization
(
void
);
int
main
(
void
)
{
int
main
(
void
)
{
...
@@ -376,6 +382,33 @@ int main(void) {
...
@@ -376,6 +382,33 @@ int main(void) {
}
}
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
);
printf
(
"DMA %d configured. Starting the transfer.
\n
"
,
ch
);
dma_done_irq_expected
=
1
;
dma_done_irq_occurred
=
0
;
NVIC_ClearPendingIRQ
(
DMA_IRQn
);
NVIC_EnableIRQ
(
DMA_IRQn
);
// Start DMA operation and wait for done IRQ
AdaEnable
(
ch
,
SECURE
);
__WFI
();
uint8_t
ch_enabled
=
1
;
while
(
ch_enabled
==
1
)
{
ch_enabled
=
AdaGetEnable
(
ch
,
SECURE
);
}
printf
(
"DMA transfer finished
\n
"
);
}
UartEndSimulation
();
UartEndSimulation
();
return
0
;
return
0
;
}
}
...
@@ -435,3 +468,20 @@ unsigned int address_test_read(unsigned int addr)
...
@@ -435,3 +468,20 @@ unsigned int address_test_read(unsigned int addr)
);
);
}
}
#endif
#endif
void
DMA_Handler
(
void
){
// Check the source of the interrupt and clear interrupts
printf
(
"DMA Interrupted
\n
"
)
AdaStatType
ST
=
AdaReadStatus
(
ch
,
NON_SECURE
);
if
(
ST
.
STAT_DONE
==
1
)
{
AdaClearChDone
(
ch
,
NON_SECURE
);
}
else
if
(
ST
.
STAT_ERR
==
1
)
{
AdaClearChError
(
ch
,
NON_SECURE
);
}
else
if
(
ST
.
STAT_DISABLED
==
1
)
{
AdaClearChDisabled
(
ch
,
NON_SECURE
);
}
else
if
(
ST
.
STAT_STOPPED
==
1
)
{
AdaClearChStopped
(
ch
,
NON_SECURE
);
}
else
{
printf
(
"Unknown IRQ on CH%d!
\n
"
,
ch
);
}
}
\ No newline at end of file
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