11# -*- coding: utf-8 -*-
22
33import arch
4- import api .utils
5- import api .config
4+ import src . api .utils
5+ import src . api .config
66
7- from api .debug import __DEBUG__
8- from api .identityset import IdentitySet
7+ from src . api .debug import __DEBUG__
8+ from src . api .identityset import IdentitySet
99from .memcell import MemCell
1010from .labelinfo import LabelInfo
1111from .helpers import ALL_REGS , END_PROGRAM_LABEL
@@ -389,7 +389,7 @@ def is_used(self, regs, i, top=None):
389389
390390 return True
391391
392- regs = api .utils .flatten_list ([helpers .single_registers (x ) for x in regs ]) # make a copy
392+ regs = src . api .utils .flatten_list ([helpers .single_registers (x ) for x in regs ]) # make a copy
393393 for ii in range (i , top ):
394394 if any (r in regs for r in self .mem [ii ].requires ):
395395 return True
@@ -565,7 +565,7 @@ def optimize(self, patterns_list):
565565 'z' : str (self .cpu .Z ) if self .cpu .Z is not None else helpers .new_tmp_val ()
566566 }.get (x .lower (), helpers .new_tmp_val ())
567567
568- if api .config .OPTIONS .optimization > 3 :
568+ if src . api .config .OPTIONS .optimization > 3 :
569569 regs , mems = self .guesses_initial_state_from_origin_blocks ()
570570 else :
571571 regs , mems = {}, {}
@@ -591,8 +591,8 @@ def optimize(self, patterns_list):
591591 new_code = list (code )
592592 matched = new_code [i : i + len (p .patt )]
593593 new_code [i : i + len (p .patt )] = p .template .filter (match )
594- api .errmsg .info ('pattern applied [{}:{}]' .format ("%03i" % p .flag , p .fname ))
595- api .debug .__DEBUG__ ('matched: \n {}' .format ('\n ' .join (matched )), level = 1 )
594+ src . api .errmsg .info ('pattern applied [{}:{}]' .format ("%03i" % p .flag , p .fname ))
595+ src . api .debug .__DEBUG__ ('matched: \n {}' .format ('\n ' .join (matched )), level = 1 )
596596 changed = new_code != code
597597 if changed :
598598 code = new_code
0 commit comments