addCoreSpecification :: CoreId -> C.CGen ()
addCoreSpecification coreId = do
    let (sr, sc) = systemCoord coreId
        setRow   = "asm(\".set __CORE_ROW_," ++ show sr ++ "\");"
        setCol   = "asm(\".set __CORE_COL_," ++ show sc ++ "\");"
    C.addGlobal [cedecl| extern int _CORE_ROW_; |]
    C.addGlobal [cedecl| $esc:("asm(\".global __CORE_ROW_\");") |]
    C.addGlobal [cedecl| $esc:setRow |]
    C.addGlobal [cedecl| extern int _CORE_COL_; |]
    C.addGlobal [cedecl| $esc:("asm(\".global __CORE_COL_\");") |]
    C.addGlobal [cedecl| $esc:setCol |]
addCoreSpecification :: CoreId -> C.CGen ()
addCoreSpecification coreId = do
    let (sr, sc) = systemCoord coreId
        setRow   = "asm(\".set __CORE_ROW_," ++ show sr ++ "\");"
        setCol   = "asm(\".set __CORE_COL_," ++ show sc ++ "\");"
    C.addGlobal [cedecl| extern int _CORE_ROW_; |]
    C.addGlobal [cedecl| $esc:("asm(\".global __CORE_ROW_\");") |]
    C.addGlobal [cedecl| $esc:setRow |]
    C.addGlobal [cedecl| extern int _CORE_COL_; |]
    C.addGlobal [cedecl| $esc:("asm(\".global __CORE_COL_\");") |]
    C.addGlobal [cedecl| $esc:setCol |]
addCoreSpecification coreId = do
    let (sr, sc) = systemCoord coreId
        setRow   = "asm(\".set __CORE_ROW_," ++ show sr ++ "\");"
        setCol   = "asm(\".set __CORE_COL_," ++ show sc ++ "\");"
    C.addGlobal [cedecl| extern int _CORE_ROW_; |]
    C.addGlobal [cedecl| $esc:("asm(\".global __CORE_ROW_\");") |]
    C.addGlobal [cedecl| $esc:setRow |]
    C.addGlobal [cedecl| extern int _CORE_COL_; |]
    C.addGlobal [cedecl| $esc:("asm(\".global __CORE_COL_\");") |]
    C.addGlobal [cedecl| $esc:setCol |]