Skip to content

Commit

Permalink
Merge branch 'master' into cfg_none
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed May 2, 2024
2 parents 4330a9a + e6fa1b4 commit 2b943a4
Show file tree
Hide file tree
Showing 26 changed files with 314 additions and 311 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/c_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
packages: doxygen gcc-arm-none-eabi
- name: "Prepare: Set up Python 3.12"
# Note: Python is needed for spinn_utilities.make_tools when building
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: "Prepare: Set SPINN_DIRS"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ env:

jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand All @@ -51,7 +53,7 @@ jobs:
working-directory: c_common

- name: Build C documentation
uses: mattnotmitt/doxygen-action@v1.9.5
uses: mattnotmitt/doxygen-action@v1.9.8
with:
working-directory: c_common

Expand All @@ -60,7 +62,7 @@ jobs:
cp -vaT $ROOT_DOC_DIR $DEPLOY_DIR
cp -vaT $C_DOC_DIR $DEPLOY_DIR/c
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.4.3
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
folder: ${{ env.DEPLOY_DIR }}
4 changes: 2 additions & 2 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
path: support

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip, etc
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
repository: SpiNNakerManchester/SupportScripts
path: support
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install pip, etc
Expand Down
4 changes: 2 additions & 2 deletions c_common/front_end_common_lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ LDFLAGS += -lspinn_common

# Objects
OBJS = data_specification.o simulation.o recording.o profiler.o \
malloc_extras.o tdma_processing.o
malloc_extras.o
BUILD_OBJS = $(OBJS:%.o=$(SPINN_COMMON_BUILD)/%.o)

# Headers
HEADERS = common-typedefs.h data_specification.h simulation.h recording.h \
profiler.h buffered_eieio_defs.h debug.h eieio.h sdp_no_scp.h \
filter_info.h key_atom_map.h malloc_extras.h spinn_extra.h \
tdma_processing.h wfi.h
wfi.h
INSTALL_HEADERS = $(HEADERS:%.h=$(SPINN_INC_DIR)/%.h)

# Makefile
Expand Down
128 changes: 0 additions & 128 deletions c_common/front_end_common_lib/include/tdma_processing.h

This file was deleted.

57 changes: 0 additions & 57 deletions c_common/front_end_common_lib/src/tdma_processing.c

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,24 @@ static inline void cancel_dmas(void) {
//! \param[in] left: The index of the first route to consider.
//! \param[in] index: The index of the second route to consider.
//! \return True if the entries were merged
static inline bool find_merge(int left, int index) {
static inline bool find_merge_optimised(int left, int index) {
log_debug("find merge %d %d", left, index);
cancel_dmas();
const entry_t *entry1 = routing_table_get_entry(left);
const entry_t *entry2 = routing_table_get_entry(index);
const entry_t merged = merge(entry1, entry2);

#if LOG_LEVEL >= LOG_DEBUG
for (int check = remaining_index; check < routing_table_get_n_entries(); check++) {
const entry_t *check_entry = routing_table_get_entry(check);
log_debug("%d %08x %08x %d", check, check_entry->key_mask.key,
check_entry->key_mask.mask, check_entry->route);
}
#endif // LOG_LEVEL >= LOG_DEBUG

uint32_t size = routing_table_get_n_entries();
uint32_t items_to_go = size - remaining_index;
log_debug("size %d remaining_index %d items_to_go %d", size, remaining_index, items_to_go);
uint32_t next_n_items = transfer_next(remaining_index, items_to_go, 0);
uint32_t next_items_to_go = items_to_go - next_n_items;
uint32_t next_start = remaining_index + next_n_items;
Expand Down Expand Up @@ -144,11 +154,15 @@ static inline bool find_merge(int left, int index) {

// Check the items now available
entry_t *entries = route_cache[cache];
log_debug("to check %d", n_items);
for (uint32_t i = 0; i < n_items; i++) {
log_debug("%d %08x %08x %d", i + remaining_index, entries[i].key_mask.key,
entries[i].key_mask.mask, entries[i].route);
if (key_mask_intersect(entries[i].key_mask, merged.key_mask)) {
if (dma_in_progress) {
routing_table_wait_for_last_transfer();
}
log_debug("intersect");
return false;
}
}
Expand All @@ -159,10 +173,38 @@ static inline bool find_merge(int left, int index) {
return true;
}

//! \brief Finds if two routes can be merged.
//! \details If they are merged, the entry at the index of left is also
//! replaced with the merged route.
//! \param[in] left: The index of the first route to consider.
//! \param[in] index: The index of the second route to consider.
//! \return True if the entries were merged
static inline bool find_merge(int left, int index) {
log_debug("find merge %d %d", left, index);
cancel_dmas();
const entry_t *entry1 = routing_table_get_entry(left);
const entry_t *entry2 = routing_table_get_entry(index);
const entry_t merged = merge(entry1, entry2);

for (int check = remaining_index;
check < routing_table_get_n_entries();
check++) {
const entry_t *check_entry =
routing_table_get_entry(check);
if (key_mask_intersect(check_entry->key_mask, merged.key_mask)) {
return false;
}
}

routing_table_put_entry(&merged, left);
return true;
}

//! \brief Does the actual routing compression
//! \param[in] left: The start of the section of table to compress
//! \param[in] right: The end of the section of table to compress
static inline void compress_by_route(int left, int right) {
log_debug("merge left %d right %d", left, right);
while (left < right) {
bool merged = false;

Expand Down Expand Up @@ -209,6 +251,7 @@ static void sort_routes(void) {
//! \return Whether the update succeeded
static inline bool update_frequency(int index) {
uint32_t route = routing_table_get_entry(index)->route;
log_debug("index %d routes %d", index, route);
for (uint i = 0; i < routes_count; i++) {
if (routes[i] == route) {
routes_frequency[i]++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class TestWriteJson(unittest.TestCase):

def setUp(self):
unittest_setup()
set_config("Machine", "version", 5)
class_file = sys.modules[self.__module__].__file__
path = os.path.dirname(os.path.abspath(class_file))
os.chdir(path)
Expand Down
Loading

0 comments on commit 2b943a4

Please sign in to comment.