kuznia-rdzeni / coreblocks

RISC-V out-of-order core for education and research purposes
https://kuznia-rdzeni.github.io/coreblocks/
BSD 3-Clause "New" or "Revised" License
33 stars 13 forks source link

Move common code to a new dir #682

Closed xThaid closed 2 months ago

xThaid commented 2 months ago

I moved around a few files. The main changes:

Rationale:

  1. Importing coreblocks.frontend.decoder.isa for such a basic thing like Funct3 didn't feel right. IMO coreblocks.frontend.decoder shouldn't be a path that almost the whole core includes.
  2. There are plenty of files in coreblocks/params that don't depend on GenParams at all, but by doing import coreblocks.params we have to import GenParams with its all dependencies
  3. There was an import loop:
    test/frontend/test_fetch.py:14: in <module>
    from coreblocks.frontend.fetch.fetch import FetchUnit, PredictionChecker
    coreblocks/frontend/fetch/fetch.py:12: in <module>
    from coreblocks.frontend.decoder.rvc import InstrDecompress, is_instr_compressed
    coreblocks/frontend/decoder/__init__.py:2: in <module>
    from .optypes import *  # noqa: F401
    coreblocks/frontend/decoder/optypes.py:3: in <module>
    from coreblocks.params.isa_params import extension_implications, extension_only_implies, Extension
    coreblocks/params/__init__.py:2: in <module>
    from .genparams import *  # noqa: F401
    coreblocks/params/genparams.py:9: in <module>
    from .fu_params import extensions_supported
    coreblocks/params/fu_params.py:7: in <module>
    from coreblocks.frontend.decoder import optypes_required_by_extensions
lekcyjna123 commented 2 months ago

I see why such change is needed, but I don't like the common directory name. Last time such dir ended with containing everything which doesn't passed anywhere else. You have two isa files and one optype file, so maybe let name it arch directory or somehow similar?

tilk commented 2 months ago

Cannot merge due to conflicts.