Skip to content

Commit

Permalink
cython: Add central cython support definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Buesch <[email protected]>
  • Loading branch information
mbuesch committed Jun 23, 2018
1 parent c3b414f commit 608c2af
Show file tree
Hide file tree
Showing 563 changed files with 609 additions and 24 deletions.
1 change: 1 addition & 0 deletions awlsim/awlcompiler/insntrans.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.cpuspecs import * #+cimport
Expand Down
1 change: 1 addition & 0 deletions awlsim/awlcompiler/optrans.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.sources import AwlSource
Expand Down
1 change: 1 addition & 0 deletions awlsim/awlcompiler/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

import sys
Expand Down
1 change: 1 addition & 0 deletions awlsim/awlcompiler/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.cpuconfig import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/awloptimizer/awloptimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/awloptimizer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.enumeration import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/awloptimizer/opt_biefwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.cpuconfig import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/awloptimizer/opt_lblrem.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.awloptimizer.base import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/awloptimizer/opt_noprem.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.awloptimizer.base import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/blocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *


Expand Down
1 change: 1 addition & 0 deletions awlsim/common/blockinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.enumeration import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/codevalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/cpuconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/cpuspecs.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from awlsim.common.cython_support cimport *
from awlsim.core.cpu cimport *

cdef class S7CPUSpecs(object):
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/cpuspecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
12 changes: 12 additions & 0 deletions awlsim/common/cython_support.pxd.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Get all stdint types.
from libc.stdint cimport *

# Boolean type. The values 0 and 1 can be used.
ctypedef bint _Bool

# Extended boolean type for use as return type from
# functions that can raise exceptions.
# The values 0 and 1 can be used.
# An exception is encoded as special value ExBool_val.
ctypedef signed int ExBool_t
cdef enum: ExBool_val = -1
22 changes: 22 additions & 0 deletions awlsim/common/cython_support.pyx.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
#
# AWL simulator - Cython support
#
# Copyright 2018 Michael Buesch <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#


2 changes: 2 additions & 0 deletions awlsim/common/datatypehelpers.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from awlsim.common.cython_support cimport *

cdef uint16_t swapEndianWord(uint16_t word)
cdef uint32_t swapEndianDWord(uint32_t dword)

Expand Down
1 change: 1 addition & 0 deletions awlsim/common/datatypehelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

import gc as garbageCollector
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/dynamic_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/enumeration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *


Expand Down
1 change: 1 addition & 0 deletions awlsim/common/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.enumeration import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/hwmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.xmlfactory import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/immutable.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *


Expand Down
2 changes: 2 additions & 0 deletions awlsim/common/monotonic.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from awlsim.common.cython_support cimport *

cdef class _MONOTONIC_RAW_factory(object):
cdef public object __id_CLOCK_MONOTONIC_RAW

Expand Down
1 change: 1 addition & 0 deletions awlsim/common/monotonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/namevalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.xmlfactory import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/project_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.cpuspecs import * #+cimport
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/refmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.xmlfactory import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/subprocess_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

import distutils.spawn
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *


Expand Down
1 change: 1 addition & 0 deletions awlsim/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.enumeration import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from binascii import crc32
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/wordpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/common/xmlfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.enumeration import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/blockinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.util import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/blocks.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from awlsim.common.cython_support cimport *
from awlsim.core.lstack cimport *

cdef class Block(object):
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.refmanager import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/callstack.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from awlsim.common.cython_support cimport *
from awlsim.core.cpu cimport *
from awlsim.core.blocks cimport *
from awlsim.core.datablocks cimport *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/callstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/counters.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from awlsim.common.cython_support cimport *
from awlsim.core.cpu cimport *

cdef class Counter(object):
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

from awlsim.common.exceptions import *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/cpu.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from awlsim.common.cython_support cimport *
from awlsim.core.statusword cimport *
from awlsim.core.callstack cimport *
from awlsim.core.lstack cimport *
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#

from __future__ import division, absolute_import, print_function, unicode_literals
#from awlsim.common.cython_support cimport * #@cy
from awlsim.common.compat import *

import time
Expand Down
1 change: 1 addition & 0 deletions awlsim/core/datablocks.pxd.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from awlsim.common.cython_support cimport *
from awlsim.core.blocks cimport *
from awlsim.core.datastructure cimport *
from awlsim.core.offset cimport *
Expand Down
Loading

0 comments on commit 608c2af

Please sign in to comment.