How to use coreir - 1 common examples

To help you get started, we’ve selected a few coreir examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github StanfordAHA / lassen / scripts / gen_rules.py View on Github external
def discover(file_name):

    c = coreir.Context()
    mapper = mm.PeakMapper(c,"pe_ns")
    mapper.add_peak_primitive("PE",gen_pe)

    def bypass_mode(inst):
        return (
            inst.rega == type(inst.rega).BYPASS and
            inst.regb == type(inst.regb).BYPASS and
            inst.regd == type(inst.regd).BYPASS and
            inst.rege == type(inst.rege).BYPASS and
            inst.regf == type(inst.regf).BYPASS and
            inst.alu.name[0] != 'F' and
            inst.cond.name[0] != 'F'
        )
    mapper.add_discover_constraint(bypass_mode)
    rrs = mapper.discover_peak_rewrite_rules(width=16,serialize=True,verbose=1)
    print(rrs)

coreir

Python bindings for CoreIR

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis

Popular coreir functions