Skip to content

Commit

Permalink
Merge bf7f5b6 into 8ac688c
Browse files Browse the repository at this point in the history
  • Loading branch information
snim2 committed Jul 27, 2016
2 parents 8ac688c + bf7f5b6 commit e037a14
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .landscape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pylint:
disable:
- too-many-arguments
- unused-argument
- unused-import

4 changes: 2 additions & 2 deletions revelation/instruction.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Instruction(object):
def __init__(self, bits, str):
def __init__(self, bits, name):
self.bits = bits
self.str = str
self.name = name

@property
def rd(self):
Expand Down
5 changes: 0 additions & 5 deletions revelation/isa.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

from pydgin.misc import create_risc_decoder

try:
from rpython.rlib.objectmodel import we_are_translated
except ImportError:
we_are_translated = lambda : False


reg_map = {
'r0' : 0, 'r1' : 1, 'r2' : 2, 'r3' : 3,
Expand Down
5 changes: 1 addition & 4 deletions revelation/machine.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from revelation.isa import reg_map
from revelation.storage import MemoryMappedRegisterFile

try:
from rpython.rlib.rarithmetic import intmask
except ImportError:
intmask = lambda x : x

RESET_ADDR = 0
PC_ADDRESS = 0xf0408


class State(object):
_virtualizable_ = ['num_insts']

Expand Down
18 changes: 3 additions & 15 deletions revelation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@

import math

try:
from rpython.rlib.rarithmetic import r_uint, intmask
from rpython.rlib.objectmodel import specialize
except ImportError:
r_uint = lambda x : x
intmask = lambda x : x
class Specialize(object):
def argtype(self, fun, *args):
return lambda fun : fun
specialize = Specialize()


def get_mmr_address(rn, m0m1):
"""Return address of an memory-mapped register and its size in bits.
"""
Expand All @@ -31,8 +19,8 @@ def get_mmr_address(rn, m0m1):
def signed(value):
if value & 0x8000000:
twos_complement = ~value + 1
return -intmask(trim_32(twos_complement))
return intmask(value)
return -pydgin.utils.intmask(trim_32(twos_complement))
return pydgin.utils.intmask(value)


def reg_or_simm(state, inst, is16bit):
Expand Down Expand Up @@ -74,7 +62,7 @@ def sext_24(value):
return value


@specialize.argtype(0)
@pydgin.utils.specialize.argtype(0)
def trim_32(value):
return value & 0xffffffff

Expand Down

0 comments on commit e037a14

Please sign in to comment.