-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'FEATURE-0242-HardwareIdle-Mothership' of github.com:POE…
…TSII/Orchestrator into FEATURE-0242-HardwareIdle-Mothership
- Loading branch information
Showing
9 changed files
with
235 additions
and
8 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
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
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,23 @@ | ||
#ifndef _VARS_H_ | ||
#define _VARS_H_ | ||
#include <cstdint> | ||
#include "softswitch_common.h" | ||
|
||
extern ThreadCtxt_t Thread_0_Context; | ||
extern ThreadCtxt_t Thread_1_Context; | ||
extern ThreadCtxt_t Thread_2_Context; | ||
extern ThreadCtxt_t Thread_3_Context; | ||
extern ThreadCtxt_t Thread_4_Context; | ||
extern ThreadCtxt_t Thread_5_Context; | ||
extern ThreadCtxt_t Thread_6_Context; | ||
extern ThreadCtxt_t Thread_7_Context; | ||
extern ThreadCtxt_t Thread_8_Context; | ||
extern ThreadCtxt_t Thread_9_Context; | ||
extern ThreadCtxt_t Thread_10_Context; | ||
extern ThreadCtxt_t Thread_11_Context; | ||
extern ThreadCtxt_t Thread_12_Context; | ||
extern ThreadCtxt_t Thread_13_Context; | ||
extern ThreadCtxt_t Thread_14_Context; | ||
extern ThreadCtxt_t Thread_15_Context; | ||
|
||
#endif /*_VARS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "tinsel.h" | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
// Block on tinselIdle to facilitate hardware idle. | ||
while(true) tinselIdle(1); | ||
|
||
return 0; | ||
} |
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,20 @@ | ||
|
||
#include "softswitch_common.h" | ||
#include "softswitch_vars.h" | ||
|
||
ThreadCtxt_t Thread_0_Context __attribute__((weak, section (".thr0_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_1_Context __attribute__((weak, section (".thr1_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_2_Context __attribute__((weak, section (".thr2_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_3_Context __attribute__((weak, section (".thr3_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_4_Context __attribute__((weak, section (".thr4_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_5_Context __attribute__((weak, section (".thr5_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_6_Context __attribute__((weak, section (".thr6_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_7_Context __attribute__((weak, section (".thr7_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_8_Context __attribute__((weak, section (".thr8_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_9_Context __attribute__((weak, section (".thr9_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_10_Context __attribute__((weak, section (".thr10_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_11_Context __attribute__((weak, section (".thr11_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_12_Context __attribute__((weak, section (".thr12_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_13_Context __attribute__((weak, section (".thr13_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_14_Context __attribute__((weak, section (".thr14_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; | ||
ThreadCtxt_t Thread_15_Context __attribute__((weak, section (".thr15_base"))) = {0,PNULL,0,PNULL,PNULL,0,PNULL,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
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,70 @@ | ||
#include "config.h" | ||
|
||
#include <string> | ||
#include <iostream> | ||
#include <iomanip> | ||
#include <fstream> | ||
#include <stdio.h> | ||
#include <math.h> | ||
|
||
|
||
// Number of bytes per thread partition 2^21 = 2,097,152 | ||
uint32_t BytesPerDRAMPartition=1<<TinselLogBytesPerDRAMPartition; | ||
|
||
// The number of cores that share a DRAM 2^(2+3) = 32 | ||
uint32_t CoresPerDRAM=1<<(TinselLogCoresPerDCache+TinselLogDCachesPerDRAM); | ||
|
||
// The number of threads per DRAM 32*16 = 512 | ||
uint32_t ThreadsPerDRAM=CoresPerDRAM*TinselThreadsPerCore; | ||
|
||
uint32_t InterleavedPartitionOffset=0x80000000; | ||
|
||
int main(void) | ||
{ | ||
// The output binary | ||
std::ofstream dataBin; | ||
|
||
dataBin.open("threadCtxInit_data.v"); | ||
if(dataBin.fail()) // Check that the file opened | ||
{ // if it didn't, barf | ||
std::cout << "***ERROR*** FAILED TO OPEN DATA BINARY\n" << std::endl; | ||
return -1; | ||
} | ||
|
||
// Populate the bin | ||
uint32_t i = 0; | ||
for(int coreNum = 0; coreNum<CoresPerDRAM; coreNum++) | ||
{ | ||
for(int threadNum = 1; threadNum<=TinselThreadsPerCore; threadNum++) | ||
{ | ||
uint32_t threadAddr, threadOffset; | ||
|
||
threadOffset = ((coreNum << TinselLogThreadsPerCore) + threadNum); | ||
threadOffset *= BytesPerDRAMPartition; | ||
|
||
threadAddr = TinselBytesPerDRAM - threadOffset; | ||
|
||
threadAddr |= InterleavedPartitionOffset; | ||
|
||
// Write the address | ||
dataBin << std::hex << std::uppercase << "@" << threadAddr << "\n"; | ||
|
||
// Write out the initialiser | ||
dataBin << "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n"; | ||
dataBin << "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n"; | ||
dataBin << "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n"; | ||
dataBin << "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n"; | ||
dataBin << "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n"; | ||
dataBin << "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 \n"; | ||
dataBin << "00 00 00 00 00 00 00 00 " << std::endl; | ||
|
||
i++; | ||
} | ||
} | ||
|
||
// And we are done | ||
dataBin.close(); | ||
|
||
return 0; | ||
} | ||
|