-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for pulp-nnx as N-EUREKA testbench driver.
This is not yet as clean as it should be. In particular, the neureka_bsp.h is a compromise to "keep it simple", which most likely will need to be changed to merge into main.
- Loading branch information
1 parent
9afe077
commit e7db934
Showing
7 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifdef NNX_NEUREKA_TESTBENCH | ||
#include "neureka_testbench_bsp.h" | ||
#define neureka_bsp_conf_t neureka_testbench_conf_t | ||
#define neureka_bsp_open neureka_testbench_open | ||
#define neureka_bsp_close neureka_testbench_close | ||
#define neureka_bsp_event_wait_and_clear neureka_testbench_event_wait_and_clear | ||
#else | ||
#include "neureka_siracusa_bsp.h" | ||
#define neureka_bsp_conf_t neureka_siracusa_conf_t | ||
#define neureka_bsp_open neureka_siracusa_open | ||
#define neureka_bsp_close neureka_siracusa_close | ||
#define neureka_bsp_event_wait_and_clear neureka_siracusa_event_wait_and_clear | ||
#endif |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Luka Macan <[email protected]> | ||
* Francesco Conti <[email protected]> | ||
* | ||
* Copyright 2023 ETH Zurich and University of Bologna | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "neureka_testbench_bsp.h" | ||
#include <pmsis.h> | ||
|
||
#define NEUREKA_TESTBENCH_CLUSTER_CTRL_BASE_ADDR (0x00100000) | ||
#define NEUREKA_TESTBENCH_BASE_ADDR (0x00100000) | ||
// fixme | ||
// #define NEUREKA_TESTBENCH_WEIGHT_MEM_BASE_ADDR (0x10400000) | ||
// #define NEUREKA_TESTBENCH_WEIGHT_MEM_MRAM_OFFSET (0x00000000) | ||
// #define NEUREKA_TESTBENCH_WEIGHT_MEM_SRAM_OFFSET (0x00400000) | ||
|
||
void neureka_testbench_open(neureka_testbench_conf_t *conf) { | ||
return; | ||
} | ||
|
||
void neureka_testbench_close() { | ||
return; | ||
} | ||
|
||
void neureka_testbench_event_wait_and_clear() { | ||
asm volatile ("wfi" ::: "memory"); | ||
} | ||
|
||
static const neureka_dev_t neureka_testbench_dev = { | ||
.hwpe_dev = (struct hwpe_dev_t){ | ||
.base_addr = (volatile uint32_t *)NEUREKA_TESTBENCH_BASE_ADDR}}; | ||
|
||
const neureka_dev_t *neureka_testbench_get_dev() { | ||
return &neureka_testbench_dev; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Luka Macan <[email protected]> | ||
* | ||
* Copyright 2023 ETH Zurich and University of Bologna | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef __NEUREKA_TESTBENCH_BSP_H__ | ||
#define __NEUREKA_TESTBENCH_BSP_H__ | ||
|
||
#include "neureka.h" | ||
#include <stdint.h> | ||
|
||
typedef struct neureka_testbench_conf_t { | ||
int max_stall; | ||
} neureka_testbench_conf_t; | ||
|
||
void neureka_testbench_open(neureka_testbench_conf_t *conf); | ||
void neureka_testbench_close(); | ||
void neureka_testbench_event_wait_and_clear(); | ||
const neureka_dev_t *neureka_testbench_get_dev(); | ||
|
||
#endif // !__NEUREKA_TESTBENCH_BSP_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters