xcore / tool_axe

An XCore Emulator
Other
15 stars 8 forks source link

setParent() in createNodeFromConfig() has a dependence on cores.size() #9

Closed jameshanlon closed 12 years ago

jameshanlon commented 12 years ago

The 'setParent() method called in 'addCore' (Node.cpp:17) has a dependence on the size of the 'cores' vector in Node (setParent --> seeNewNodeID --> getCoreID -->getCoreID --> getCoreNumBits. This should be called after all cores have been added to a Node.

Fixed this in: https://github.com/jameshanlon/tool_axe/commit/68d8d582b55ff5ff621faff03d8baafb29eaaea3

rlsosborne commented 12 years ago

Was this causing a problem in practice? I can see the potential issue (and it would be good to tidy up the code) but it shouldn't matter if the coreID is set incorrectly when the core is added as node->setNodeID(nodeID) is called after the cores are added and this causes the coreID to be recalculated with the right values (unless I'm missing something).

jameshanlon commented 12 years ago

For a 128 core network it causes the following assertion to be raised:

$ axe a.128.xe axe: Node.cpp:58: uint32_t Node::getCoreID(unsigned int) const: Assertion `coreNum <= makeMask(getCoreNumberBits())' failed. Aborted