Kratos: a hardware design language written in C++/Python

First steps

This sections demonstrates the basic features of kratos. Before getting started, make sure that development environment is set up to run the included tests.

Installing kratos

kratos requires Python 3.6+. Please make sure that you have necessary Python environment set up.

Linux/macOS/Windows

You can simply do

pip install kratos

This will download the pre-compiled binary wheel.

Other OS/ Compiling from source

You need a C++-17 compatible compiler with <filesystem> enabled. g++-8 or clang++-8 should be sufficient. Also making sure that you have met the following dependencies:

  • CMake

If your system doesn’t come with a recent cmake, you can install cmake through your pip:

pip install cmake

Then you should be able to install using the following command

git clone https://github.com/Kuree/kratos
cd kratos
git submodule init && git submodule update
pip install .

Development setup

You can simply do

pip install -e .

Create a simple pass-through module

In kratos, every module is a live generator object. You can create a circuit definition inside __init__() constructor, just as normal Python object. This allows you to fuse configuration with the circuit itself, which can be used to provide single-source-of-truth in hardware design.

from kratos import *

class PassThroughMod(Generator):
    def __init__(self):
        super().__init__("PassThrough", False)
        self.in_ = self.input("in", 1)
        self.out_ = self.output("out", 1)
        self.wire(self.out_, self.in_)

super().__init__("PassThrough", False) tells the underlying system to create a verilog module called PassThrough and we don’t want debug information (thus False).

We now can go ahead and instantiate a path through module:

mod = PassThroughMod()

To produce a system verilog file called “mod.sv” in the current working directory, we can simply call a helper function

verilog(mod, filename="mod.sv")

Looking at the content of mod.sv, we can see the following system verilog definition:

1
2
3
4
5
6
7
module PassThrough (
  input logic  in,
  output logic  out
);

assign out = in;
endmodule   // PassThrough

To see how debug works, we can modify the super() base class constructor into

super().__init__("PassThrough", True)

Now if we call verilog() with debug on, such as

verilog(mod, filename="mod.sv", debug=True)

We will have an additional debug information file called mod.sv.debug in the same directory as mod.sv, which is a JSON file indexed by line number.

{
  "1": [["/tmp/kratos/example.py", 3]],
  "2": [["/tmp/kratos/example.py", 4]],
  "3": [["/tmp/kratos/example.py", 5]],
  "6": [["/tmp/kratos/example.py", 6]]}

Put everything together

Here is an example that prints out the pass through module

import kratos

class PassThroughMod(kratos.Generator):
    def __init__(self):
        super().__init__("PassThrough", False)
        self.in_ = self.input("in", 1)
        self.out_ = self.output("out", 1)
        self.wire(self.out_, self.in_)


mod = PassThroughMod()
mod_src = kratos.verilog(mod)
print(mod_src["PassThrough"])

Generator of Generators

Kratos follows the idea of generators of generators. Every class inherits from kratos.Generator class is a generator which can generate different circuit based on different parameters. To push the generator idea even further, you can modify the circuit even after being instantiated from a generator class. The backend engine can take of the additional changes.

There are two ways to populate circuit definition to the generator:

  1. Free-style code block
  2. Procedural code generation

Each approach has its own strengths and drawbacks. In general, using code block makes the Python code more readable and procedural code generation is more flexible and universal. If you look at the source code, free-style code block is just a helper to construct circuit definition procedurally.

Port and Variables

As in verilog, we need to declare ports and variables before we can describe the circuit logic. To declare a port, you can call the port function from the generator:

def port(self, name: str, width: int, direction: PortDirection,
         port_type: PortType = PortType.Data,
         is_signed: bool = False, size: int = 1,
         packed: bool = False)

PortDirection and PortType are enums to specify the types of the port we’re creating. The definitions for these enum are:

class PortDirection(enum.Enum):
    In = _kratos.PortDirection.In
    Out = _kratos.PortDirection.Out
    InOut = _kratos.PortDirection.InOut


class PortType(enum.Enum):
    Data = _kratos.PortType.Data
    Clock = _kratos.PortType.Clock
    AsyncReset = _kratos.PortType.AsyncReset
    ClockEnable = _kratos.PortType.ClockEnable
    Reset = _kratos.PortType.Reset

Notice that _kratos is a namespace that came from the native C++ binding. kratos also has some helper functions to help you create commonly used ports:

def input(self, name, width, port_type: PortType = PortType.Data,
          is_signed: bool = False, size: int = 1, packed: bool = False)

def output(self, name, width, port_type: PortType = PortType.Data,
           is_signed: bool = False, size: int = 1, packed: bool = False)

def clock(self, name, is_input=True)

def reset(self, name, is_input=True, is_async=True)

To declare a variable, simply call the following function to create one:

def var(self, name: str, width: int,
         is_signed: bool = False)

kratos will do type checking for width, port_type, and is_signed to avoid any implicit conversion that could be difficult to detect.

Variable Proxies

For simple modules, it is fine to hold a port/variable/parameters as class attributes. However, as the generator gets more complicated, it may be difficult to maintain all the variable names. kratos Generator comes with handy proxies to access all the variables you need. You can access a port either through

  • [gen].ports.port_name
  • [gen].ports["port_name"]

where [gen] is any generator instance and port_name is the name you want to access. Similarly, you can use

  • [gen].vars.port_name
  • [gen].vars["port_name]

and [gen].params for parameters.

Expressions

Whenever we perform some arithmetic or logic operator on port/variables, we implicitly create an expression. An expression can be assigned to a port or a variable. It can also be composed together to form more complex expressions.

>>> from kratos import *
>>> g = Generator("mod")
>>> a = g.var("a", 1)
>>> b = g.var("b", 1)
>>> c = a + b
>>> c
a + b
>>> d = c + c
>>> d
(a + b) + (a + b)

To avoid conflicts with python built-in functions, some verilog operators are not directly implemented as operator overloads in Python:

  1. eq() for logical comparison
  2. ashr() for signed arithmetic shift right.

Constants

Kratos’s Python front-end will try it’s best to do conversation, when it deeds type-safe. For instance, you can directly adding python integers to a Kratos variable, or simply wire(a, 1), where a is a Kratos variable. However, if due to either type checking or some special cases where the type conversation doesn’t work, you can call const function to specify the constant value. The rule of thumb is to use explicit constant call as much as possible and only use the implicit conversion when you know it’s going to be safe. Here is the const function definition

def const(value: int, width: int, signed: bool = False)

Note

Say we have var + num, where var is either a port or variable and num is a python integer. The rules of implicit conversation is 1. The converted constant will have the same width as the var 2. The converted constant will have the same sign as the var.

If the value is out of range, an exception will thrown and you have to use either concatenate or slice the left hand side.

Arrays

ND Array is supported in kratos. You can create an array though the Generator.var() function call and set the size to the array size in a similar way as numpy array. For instance, if a.size = (3, 4, 5), then a[0] will have size (4, 5) and a[0][0] will have size 5.

def var(self, name: str, width: Union[int, _kratos.Param, _kratos.Enum],
      is_signed: bool = False, size: Union[int, Union[List, Tuple]] = 1,
      packed: bool = False, explicit_array: bool = False)

Note

By default, kratos creates unpacked array to allow better error/warning checking in downstream tools. However, users can override this by setting packed=True during the variable or port construction.

Enums

Enums are type-checked and compiled directly into SystemVerilog enum directly. Currently are limited to generate scope and cannot be shared across different generators. This many change in the future.

To use enum, first you need to define an enum definition, then you create enum variables based on the enum definition. You can only assign enum values to these enum variables:

mod = Generator("mod")
state = mod.enum("STATE", {"IDLE": 0, "READY": 1})
v = mod.enum_var("v", state)
mod.add_stmt(v.assign(state.IDLE))

This gives us:

module mod (
);

typedef enum logic {
  IDLE = 1'h0,
  READY = 1'h1
} STATE;
STATE   v;
assign v = IDLE;
endmodule   // mod

If you want Kratos automatically assign enum values for you, you can pass in a list of enum names:

mod.enum("STATE", ["IDLE", "READY])

Kratos will assign values and compute the minimum width.

Notice that you can also have global enum as well, which will be put into a SystemVerilog package when generated using output_dir. To create a global enum, simply do

state = enum("STATE", ["IDLE", "READY"])

You can global enum as your port types as well. For instance, you can do the following:

inst_def = enum("INST", ["Add","Sub", "Mult", "Div"])
inst = mod.input("inst", inst_def)

This will be generated as:

typedef enum logic[1:0] {
  Add = 2'h0,
  Sub = 2'h1,
  Mult = 2'h2,
  Div = 2'h3
} INST;

...
  input INST inst,
...

Warning

If you use local enum (defined from the generator class) as port type, you will get an exception during compilation.

Child generators

You can use add_child(inst_name, child) or add_child_generator to add a child generator. The inst_name is the instance name for that child generator and has to be unique within the parent scope. After adding the child generator to the parent scope, you can access the child generator through self[inst_name] method. __getitem__() has been overloaded to get the child.

This is a required step to properly instantiate the sub modules.

In addition to use wire() function to obtain the desired the connection between the parent and child, you can also pass the connection when adding the child generator, similar to how you instantiate a child instance in RTL:

parent = Generator("parent")
child = Generator("child")
a = parent.var("a", 1)
parent.var("b", 1)
parent.output("c", 1)
child_in = child.input("in_port", 1)
child_out1 = child.output("out_port1", 1)
child_out2 = child.output("out_port2", 1)
# we use the port name to instantiate the connection
# due to Python's limitation, we can use keyword such as "in"
# the syntax is child_port_name=parent_port
# where parent port can be either port name or port variable
parent.add_child("child_inst", child,
                 in_port=a, out_port1="b", out_port2="c")

As stated in comment section, it uses Python’s kwargs to pass in child port names and parent port. Since child port names are used as keywords, they cannot be parameterized like format string or list array, which is the limitation. If that is the case, we can always use wire function.

Note

You can pass comment to the add_child as additional argument. The comment will show up in the generated SystemVerilog to help you debug.

External Modules

kratos allows you to create either an external module or an stub.

External module

External modules are created from verilog source. You can call Generator.from_verilog to import verilog files. You need to provide the port type mapping to alow the type checking to work properly.

def from_verilog(top_name: str, src_file: str, lib_files: List[str],
                    port_mapping: Dict[str, PortType]):

lib_files lets you import related verilog files at once so you don’t have to copy these files over.

Stub module

Sometimes you’re dealing with IPs while working on an open-source project, you can create a stub that mimics the IP interface but produce junk output. kratos provides helper methods to do that. All you need to do is to set the module as a stub after declaring the interface. self.is_stub = True. The backend engine will zero out the outputs for you.

Free-Style Code Block

kratos allows to write Genesis2 style verilog code inside Python (to some extent). The basic principle is that if a Python expression can be evaluated as integer or boolean, the compiler will be happy to do so. If the Python code results in a kratos expression, the compiler will leave it as is in the verilog.

Allowed python control flows that will be statically evaluated:

  1. for
  2. if
  3. class function calls that returns a single statement

Note

In some cases, kratos will convert your for loop into standard SystemVerilog for loop to improve readability. This conversion only happens when all the following conditions match at the same time:

  1. The current generator is not in debug mode
  2. All the variables that the iterator indexed into are kratos variable

Keywords like while may or may not work depends on how it is nested side other statements.

Please also notice that kratos don’t allow generate statement in verilog, so the for loop range has to be statically determined, otherwise a SyntaxError will be thrown.

To add a code block to the generator definition, you need to wrap the code block into a class method with only self as argument, then call [gen].add_always([func]) to add the code block, where func is the function wrapper.

Combinational and Sequential Code Block

If you need to add a sequential code block that depends on some signals, you need to decorate the function wrapper with always_ff and sensitivity list. The list format is List[Tuple[EdgeType, str]], where the EdgeType can be either BlockEdgeType.Posedge or BlockEdgeType.Negedge. The str has be either a port or variable name. For instance, the code below will produce a code block that listens to clk and rst signal. Notice that if you do from kratos import *, you can use posedge or negedge directly.

@always_ff((posedge, "clk"), (posedge, "rst"))
def seq_code_block(self):
    # code here

For combinational block, you need to decorate the function with always_comb.

@always_comb
def comb_code(self):
    # code here

..warning:

You are not allowed to call these functions directly since they are
not treated as function calls. As a result, you will get a syntax
error.

Examples

Here are some examples the free-style code block in kratos that uses both combinational and sequential block. Of course you can write it in a more concise way: this is just an example of how to add code blocks.

class AsyncReg(Generator):
    def __init__(self, width):
        super().__init__("register")

        # define inputs and outputs
        self._in = self.input("in", width)
        self._out = self.output("out", width)
        self._clk = self.clock("clk")
        self._rst = self.reset("rst", 1)
        self._val = self.var("val", width)

        # add combination and sequential blocks
        self.add_always(self.seq_code_block)

        self.add_always(self.comb_code_block)

    @always_ff((posedge, "clk"), (posedge, "rst"))
    def seq_code_block(self):
        if self._rst:
            self._val = 0
        else:
            self._val = self._in

    @always_comb
    def comb_code_block(self):
        self._out = self._val

Here is the verilog produced:

>>> reg = AsyncReg(16)
>>> mod_src = verilog(reg)
>>> print(mod_src["register"]
module register (
  input logic  clk,
  input logic [15:0] in,
  output logic [15:0] out,
  input logic  rst
);

logic  [15:0] val;

always @(posedge rst, posedge clk) begin
  if (rst) begin
    val <= 16'h0;
  end
  else begin
    val <= in;
  end
end
always_comb begin
  out = val;
end
endmodule   // register

If you found the example above verbose, you can put everything inside __init__ to avoid typing self over and over again. To produce the identical verilog, you can use scoped functions to reuse the variables created before:

class AsyncReg(Generator):
    def __init__(self, width):
        super().__init__("register")

        # define inputs and outputs
        _in = self.input("in", width)
        _out = self.output("out", width)
        _clk = self.clock("clk")
        _rst = self.reset("rst", 1)
        _val = self.var("val", width)

        @always_ff((posedge, "clk"), (posedge, "rst"))
        def seq_code_block():
            if _rst:
                _val = 0
            else:
                _val = _in

        @always_comb
        def comb_code_block():
            _out = _val

        # add combination and sequential blocks
        self.add_always(seq_code_block)
        self.add_always(comb_code_block)

Here is another example on for static evaluation when the debug mode is True:

class PassThrough(Generator):
    def __init__(self, num_loop):
        super().__init__("PassThrough", True)
        self.in_ = self.input("in", 1)
        self.out_ = self.output("out", num_loop)
        self.num_loop = num_loop

        self.add_always(self.code)

    @always_comb
    def code(self):
        if self.in_ == 1:
            for i in range(self.num_loop):
                self.out_[i] = 1
        else:
            for i in range(self.num_loop):
                self.out_[i] = 0

Here is the generated verilog

>>> a = PassThrough(4)
>>> mod_src = verilog(a)
>>> print(mod_src["PassThrough"])
module PassThrough (
  input logic  in,
  output logic [3:0] out
);

always_comb begin
  if (in == 1'h1) begin
    out[0:0] = 1'h1;
    out[1:1] = 1'h1;
    out[2:2] = 1'h1;
    out[3:3] = 1'h1;
  end
  else begin
    out[0:0] = 1'h0;
    out[1:1] = 1'h0;
    out[2:2] = 1'h0;
    out[3:3] = 1'h0;
  end
end
endmodule   // PassThrough

Here is the SystemVerilog when the debug mode is off:

module PassThrough (
  input logic in,
  output logic [3:0] out
);

always_comb begin
  if (in == 1'h1) begin
    for (int unsigned i = 0; i < 4; i += 1) begin
        out[2'(i)] = 1'h1;
      end
  end
  else begin
    for (int unsigned i = 0; i < 4; i += 1) begin
        out[2'(i)] = 1'h0;
      end
  end
end
endmodule   // PassThrough

Procedural code generation

Sometimes it is very difficult to generate a desired circuit definition through limited free-style code block. If that is the case, you can use the procedural code generation.

The main idea here is to construct verilog statement in a hierarchical way. The hierarchy is defined by verilog’s begin ... end closure. Here are a list of statements you can construct:

  • SequentialCodeBlock
  • CombinationalCodeBlock
  • SwitchStmt
  • IfStmt
  • AssignStmt
  • ForStmt

Note

kratos provides a helper function called wire(var1, var2) that wires things together in the top level. In most cases the ordering does matter: it’s the same as assign var1 = var2;. The only exception is when one of them is a port (not port slice though).

Syntax sugars

Kratos’ Python front-end provides a concise front-end to create these blocks. SequentialCodeBlock can be constructed through [gen].sequential() and CombinationalCodeBlock can be constructed through [gen].combinational(). You can create a SwitchStmt through either [comb].switch_ or [seq].switch_. Similarly, you can get a IfStmt through either [comb].if_ or [seq].if_. For more details, please check out this link

To create an assignment, you can just use a normal function call to the variable/port, such as [gen].var.var_name(value), where the value can be either a variable/port/const or integer values (with implicit conversation).

Examples

Here is an example on how to build a case based N-input mux.

class Mux(Generator):
    def __init__(self, height: int, width: int):
        name = "Mux_{0}_{1}".format(width, height)
        super().__init__(name)

        # pass through wires
        if height == 1:
            self.in_ = self.input("I", width)
            self.out_ = self.output("O", width)
            self.wire(self.out_, self.in_)
            return

        self.sel_size = clog2(height)
        input_ = self.input(I, width, size=height)
        self.out_ = self.output("O", width)
        self.input("S", self.sel_size)

        # add a combinational block
        comb = self.combinational()

        # add a case statement
        switch_ = comb.switch_(self.ports.S)
        for i in range(height):
            switch_.case_(i, self.out_(input_[i]))
        # add default
        switch_.case_(None, self.out_(0))

Here is the generated verilog

module Mux_16_3 (
  input logic [15:0] I [2:0],
  output logic [15:0] O,
  input logic [1:0] S
);

always_comb begin
  case (S)
    default: O = 16'h0;
    2'h0: O = I[0];
    2'h1: O = I[1];
    2'h2: O = I[2];
  endcase
end
endmodule   // Mux_16_3

Generate SystemVerilog

kratos can only generate SystemVerilog. However, it only uses a subset of SystemVerilog features that can be understood by most open-source EDA tools such as verilator.

kratos shipped with a simple helper function that generate verilog for you:

def verilog(generator: Generator, optimize_if: bool = True,
            optimize_passthrough: bool = True,
            optimize_fanout: bool = True,
            optimize_bundle: bool = True,
            reorder_stmts: bool = False,
            check_active_high: bool = True,
            debug_fn_ln: bool = False,
            additional_passes: Dict = None,
            int_dpi_interface: bool = True,
            remove_assertion: bool = False,
            check_inferred_latch: bool = True,
            check_multiple_driver: bool = True,
            check_combinational_loop: bool = True,
            insert_pipeline_stages: bool = False,
            filename: str = None,
            output_dir: str = None,
            insert_debug_info: bool = False,
            insert_verilator_info: bool = False,
            insert_break_on_edge: bool = False,
            check_flip_flop_always_ff: bool = True,
            debug_db_filename: str = "",
            use_parallel: bool = True,
            track_generated_definition: bool = False,
            lift_genvar_instances: bool = False,
            compile_to_verilog: bool = False):

The required argument generator has to be the top level circuit you want to generate. The function returns a Python dictionary indexed by module name. If you only want to generate a system verilog file, you can provide a path to filename argument, which will output all the module definition into a single file. The reset of the argument wil be explained in advanced topics.

Notice that we can also generate a group of SystemVerilog files by specifying output_dir. Every module definition will have its own filename. If special construct is used, such as DPI function calls or packed struct, definition.svh will be created in that directory and all module files will include that header file. Kratos only override the file content if it detects a change. This very useful for incremental build for commercial simulators.

There are some experimental features that’s turned off by default. However, users can turn it on explicitly if needed:

  1. lift_genvar_instances. If set, the compiler will detect any code structure that can be folded into a genvar instance statement. This is done by detecting if there is any similar generator instantiation that wired to either the same port, or a slice of the port.

Note

Once filename or output_dir is specified, the code generator will ignore extract_struct option to ensure the generated SystemVerilog code is correct.

Note

If old Verilog, e.g., Verilog-95, is required for some EDA tools, such as yosys, you can set compile_ti_verilog to True, which will invoke sv2v to trans-compile the generated SystemVerilog code into plain Verilog code. You need to have sv2v in your PATH. You can install it from the official website: https://github.com/zachjs/sv2v, or simply install the unofficial build pip install pysv2v.

How to debug in Kratos

Debug hardware as software

One major feature of Kratos is to allow designers debug their hardware designers in a fashion close to debugging software. Kratos has a suite of tools to support a wide-range of SystemVerilog simulators such as Verilator and ncsim.

Here is a demonstration of debugging a design written in Kratos:

demo

To see more details, please visit kratos-vscode and kratos-runtime

Which line generates this SystemVerilog?

kratos comes with a GUI to help you debug the system verilog it generated. You need to install kratos-debug to use the tool:

pip install kratos-debug

Once installed, you can do

kratos-debug [src.sv]

It will launch a window as the one below:

screenshot

The left panel shows the generated verilog. You can click on any line that’s highlighted and the right panel will show you the source code that’s responsible for that particular line.

Note

To use this feature, you have to set debug=True when initializing the Generator.__init__(). In addition, you also need to use verilog(mod, debug=True, filename=[src.sv]) when generating the verilog, where mod is the top generator, and [src.sv] is the target system source file. The function will also produce [src.sv.].debug in the same directory as [src.sv]. You need that file for kratos-debug.

You can slo turn the debug mode on on a global scale. You can think global debug as -g in C/C++ compilers.

To do so, simply do

kratos.generator.set_global_debug(True)

Commenting SystemVerilog

Kratos provides a way to let users comment on on high-level constructs that will be turned into SystemVerilog comments. In most cases, you can call kratos.comment(node, comment_str) to comment any IR node.

In some helper functions where obtaining the node is impossible, these helper functions typically have optional arguments called comemnt_str that can help you to comment things.

Note

Notice that not all the node being commented will appear in SystemVerilog right now. We are actively working on refactoring codebase to completely support this feature.

Passes in Kratos

Kratos allows you to modify the entire design at any time before the code generation step. The most efficient way to modify the design is through passes. A pass is defined as a function that takes a generator and change the generator in-place to produce a different generator. There are roughly two kinds of passes in kratos:

  1. Application specific passes
  2. Symbol-level passes

Application specific Passes

Application specific passes such as power domain insertion have to be done with a particular domain knowledge. Since kratos encourages you to fuse application information into the generator class, writing a function to identify these information and act accordingly can be very straightforward. This documentation will focus on more systematic passes: symbol-level.

Symbol-Level Passes

The internal IR in kratos is constructed as an abstract syntax tree (AST) where each node is linked with a symbol. By visiting the AST we can modify the IR as well as checking for errors. This is very close to the passes in LLVM. Depending on whether the pass mutates the IR, a pass is categorized as either a analysis passes or a transformation pass. For instance, a pass to extract all the debug information is an analysis pass since it doesn’t mutate any IR node. A module instantiation pass is a transformation pass since it mutates the generate node to create a module instantiation statement.

Built-in Passes

Kratos ships with many useful passes to make the verilog more readable and your life easier:

  • fix_assignment_type: change Undefined assignment types into appropriate types. For instance, it will change top level assignments into blocking assignment, which will be code generated into assign statement.
  • remove_unused_vars: remove unused variables. It can be run multiple times after different passes to remove the artifacts.
  • verify_generator_connectivity: verify that each generator is connected properly.
  • create_module_instantiation: create module instantiation statement after user calls add_child.
  • zero_out_stubs: zero out the stub outputs.
  • check_mixed_assignment: check if there is any mixed blocking/non-blocking assignments in code blocks.
  • hash_generators_sequential: hash generators for code generation sequentially. This not encouraged to use since it’s slow.
  • hash_generators_parallel: hash generators for code generation. This is a lock-free thread-pool implementation of the hash function.
  • remove_unused_stmts: remove empty statements in top level.
  • decouple_generator_ports: create extra variable to connect sub modules, if necessary.
  • uniquify_generators: assign different module name if two are indeed different
  • generate_verilog: verilog code generation pass.
  • extract_debug_info: extract debug information.
  • extract_struct_info: extract packed struct information
  • transform_if_to_case: transform if statement into case statement if it determines appropriate. It is because Python doesn’t have switch statement, the AST produce a chained if-else statement. This pass will handle that.
  • remove_fanout_one_wires: this pass removes unnecessary wires
  • remove_pass_through_modules: this pass will remove any pass-through modules created by user. It is not necessary for the physical design, but extremely helpful to reduce the simulation size.
  • merge_wire_assignments: this pass merges top level wire slices into a single wire assignment.
  • insert_pipeline_stages: this pass insert pipeline registers on the output. You need to add an attribute to the generator you want to insert. The type string should be pipeline and value string should be [num_stages] in string. If your generator has multiple clock inputs, you have to add an attribute with {pipeline_clk, port_name} as well.
  • zero_generator_inputs: this is a pass that wires all child generator’s un-connected inputs to zero. You need to add an attribute to the parent generator. The type_str should be zero_inputs, no value_str needed. Notice that it only handles one-level down.
  • change_port_bundle_struct: automatically change the port bundle into packed struct whenever possible
  • realize_fsm: realize finite state machine into more basic primitives.
  • check_function_return: check return statement related bugs, such as missing return in some code blocks or unreachable code due to early return.
  • sort_stmts: sort the statements in the order of assignment, module instantiation, combinational, and sequential logic. This is off by default.
  • check_non_synthesizable_content: this is a pass that checks all the IR nodes in the design that is not synthesizable. It will print out all the relevant code that’s producing offending SystemVerilog code. Notice that you have to turn the debug on to see the source. An exception is thrown if detected.
  • check_inferred_latch: check to make sure there is no inferred latch in combinational and sequential code blocks. This will report where it found the corresponding assignments. Limitation: it doesn’t handle variable slicing very well. This is intended to be a quick check and no false negative. You’re still encouraged to check DC compiler warnings.
  • check_function_return: check to make sure that the function has return values if not void.
  • check_always_sensitivity: check to make sure the variable in the sensitivity list is properly typed. Only allow clock and async reset signals.
  • check_multiple_driver: check if a signal is illegally driven by multiple drivers.
  • inject_debug_break_points: inject the breakpoints in the IR, which will be used to interact with kratos-runtime.
  • inject_assert_fail_exception: inject exception into assertion when the assertion fails. This can only be used with kratos-runtime.
  • remove_assertion: remove assertion statement and transform the logic design when necessary to keep the IR succinct.
  • check_flip_flop_always_ff: make sure that always_ff is synthesizable for Design Compiler. See ELAB-302 in user guide.
  • dead_code_elimination: aggressively removes logic that does not contribute to any output logic. This will remove ports, instances, and any internal logic, including registers.
  • auto_insert_clock_enable: insert clock enable if the generator is has a clock enable port and hasn’t been marked with “dont_touch”.

Write your own Pass

Because kratos is based on C++ and binds to Python through pybind, there are two ways to write a pass:

  • C++
  • Python

The procedure to add a pass is very similar. The function has to take a top level Generator class then perform some analysis or transformation on it. All the passes in kratos rely on the IRVisitor class, which recursively visit each symbols in the IR. For C++ users you need to check how the passes is done in src/pass.cc, where all the passes listed above are implemented there.

To write a pass in Python, you can inherit the class in the same way as C++. Here is an example that changes every generator’s out port into test

def change_name(generator):
    class Visitor(IRVisitor):
        def __init__(self):
            IRVisitor.__init__(self)

        def visit(self, node):
            if isinstance(node, Port):
                # rename the output port
                if node.name == "out":
                    node.name = "test"

    visitor = Visitor()
    visitor.visit_root(generator)

To add the pass, you can add the pass into verilog function call. The additional passes will be executed at the very beginning.

verilog(mod, additional_passes={"name_change": change_name})

If you want to control the ordering of the passes being executed, it is very easy to do so in kratos. You can obtain a PassManager from VerilogModule:

code_gen = _kratos.VerilogModule(generator.internal_generator)
pass_manager = code_gen.pass_manager()

Then you have to register your own passes using the following function call:

pass_manager.register_pass(name, fn)

where name is the name to be registered in the PassManager and fn is the function. After pass registration, you can call add_pass(pass_name) to add passes in order, such as

pass_manager.add_pass("fix_assignment_type")

After registering and adding passes, you can call code_gen.run_passes to run all the passes in the order you give. To get verilog out, you can use code_gen.verilog_src(), which returns a dictionary of verilog source code indexed by the module name.

Note

All the built-in passes have been pre-registered. You can just use the name to add the built-in passes.

A note on parallelism

Kratos tries to speed up as much as possible by using a threadp pool. By default, it uses up to half of the number of CPUs reported by your system. This is to ensure the compilation won’t interference with other jobs. However, should you want to change this behavior, you can use _kratos.util.set_num_cpus(num)` to change the behavior.

Note

Due to Python’s GIL, you cannot run a passes written in Python in parallel in kratos’ backend. This is the technical limitation of Python.

Helper functions for your passes

Kratos comes with many helper functions to make writing passes easier. Here is a list of helper functions:

  • [gen].replace(child_instance_name, new_child). This function replace the child generator child_instance_name with the new generator child new_child, in the context of [gen], which is a Generator object. It does all the proper type checking and connection linking for you, in a very efficient manner.
  • Var.move_src_to(old_var, new_var, parent_gen, keep_connection). This is a static function that moves the old_var’s sources to new_var, in the context of parent_gen. If keep_connection is set to true, it will create a wiring connection between the old_var and the new_var. Notice that if you’re using this function in Python, you have to call [gen].internal_generator to get the actual C++ generator object as parent_gen.
  • Var.move_sink_to(old_var, new_var, parent_gen, keep_connection). This is a static function that moves the old_var’s sinks to new_var, in the context of parent_gen. This serves the similar functionality as Var.move_src_to().

Efficient Generator Clones

kratos has provided an efficient way to clone generators and modify the clones. Similar to the “copy-on-write”, the Python front-end allows users to create explicit copies and allow them to be initialized later for further editing.

Design Philosophy on CoW

The CoW mechanism is still work-in-progress, so the interface may subject to change.

  • We want each clones have unique generator information. Since kratos is embedded into the Python language, we can leveraging the Object-Oriented-Programming in Python. This requires every non-verilog information has to be properly initialized during the clone process.
  • Since kratos is the generator of generators, we allow user to edit cloned generators. This requires the circuit definition to be initialized prior to the editing, hence the “copy” part.

Implement Generator Clones with create

To avoid excessive computation in kratos’ CoW mechanism, your generators have to meet the following requirements:

  1. Every argument to the Generator has to be hashable. For custom classes, you need to override __hash__ function.

  2. Your custom generator __init__ function takes is_clone as an argument and passes it to the base class generator init call. For instance, you need something like:

    class Mod(Generator):
        def __init__(self, width, is_clone=False):
            super().__init__(f"mod_{width}", is_clone=is_clone)
    
  3. You have to call [Generator_Name].create() for every generator instantiation, where [Generator_Name] is your generator class name. You have to use named arguments for all your __init__ arguments. For instance, to create an instance of the Mod class, we can call

    mod1 = Mod.create(width=1)
    mod2 = Mod.create(width=1)
    

    mod1 and mod2 will share the same generator definition.

  4. If you want to make edits to the generators, you need to call initialize_clone on that particular instance. This function call ensures the full-instantiation of the generator definition, i.e. the “copy” part in CoW. You can do the following before editing the generator:

    if mod1.is_cloned:
        mod1.initialize_clone()
    

kratos also provides you the pointer reference to the generator that a clone is referring to. You can access it through [gen].def_instance. This is useful if you want to modify the entire generator definition along with all the clones.

A more efficient yet shallow clone using clone

If you don’t care about the Python variable initialization but care much about performance, kratos provides a mechanism that copies the IO and parameter definitions over, using clone(**kargs) function calls. The invocation is the same as create(**kargs), and doesn’t require you to have is_clone in __init__. However, you are not able to modify or initialize the cloned instance. In addition, the type of the cloned instance will be the generic Generator. You can still access the original instance though def_instance though. Here is a table of summary of the differences between create and clone.

Properties create clone
Correct type()
Most efficient
Able to initialize and edit
Has def_instance reference
Need to have is_clone argument in __init__

A general rule is that if you’re building some basic building blocks that will be used very often yet doesn’t care about the embedded information, you should use clone, otherwise create is recommended.

Generator Parameters

Although it is perfectly fine to create different modules given different generator parameters, sometimes it’s much cleaner to create a “verilog” parameter. Using this kind of parameter reduces the number of modules being generated and make the code more readable. An example for this usage is configuration registers, where the register enable is on if the address matches with a fixed value. We can of course pass the fixed value, i into the system and make the generator name into config_ref_{i}. The problem comes when you have multiple configuration registers. With kratos’ parameter feature, you can specify the fixed value as a parameter, just as in verilog.

Examples

Kratos allows you to either parameterize constant values or variable widths. Although it’s more restricted than what SystemVerilog offers, it should cover the majority of use cases. You can also directly use Python’s meta-programming to parameterize your generators.

Here is the function definition for parameter

def parameter(self, name: str, width: int, default_value=0,
                is_signed: bool = False)
# param is an alias of parameter
def param(self, name: str, width: int, default_value=0,
          is_signed: bool = False)

Parameterize constant values

We can create a module that add value to the input and then output the sum. Here is the python code that defines a module called add_value. Here we created a parameter called value.

class ParameterModule(kratos.Generator):
  def __init__(self, width):
      super().__init__("add_value")
      in_  = self.port("in", width, kratos.PortDirection.In)
      out_ = self.port("out", width, kratos.PortDirection.Out)
      self.value_param = self.param("value", width, default_value=0)
      self.add_stmt(out_.assign(in_ + self.value_param))

Here is the generated verilog:

module add_value (
  input logic [15:0] in,
  output logic [15:0] out
);

parameter value = 16'h0;
assign out = in + value;
endmodule   // add_value

To use the parameter in a parent generator, you can simply set the parameter value on that generator instance. In the following example, we set the parameter to 42.

class ParentModule(kratos.Generator):
    def __init__(self):
        super().__init__("parent")
        width = 16
        self.port("in", width, kratos.PortDirection.In)
        self.port("out", width, kratos.PortDirection.Out)
        adder = ParameterModule(width)
        adder.value_param.value = 42
        self.add_child("adder", adder)
        self.wire(adder.ports["in"], self.ports["in"])
        self.wire(self.ports["out"], adder.ports["out"])

Here is the generated verilog for the parent module:

module parent (
  input logic [15:0] in,
  output logic [15:0] out
);

add_value #(
  .value(16'h2A)) adder (
  .out(out),
  .in(in)
);

endmodule   // parent

Parameterize variable width

When you create a port or a variable from the generator, you can pass in a parameter as width.

Here is an example on how to use it:

mod = Generator("mod")
param = mod.param("P", 4, 4)
in_ = mod.input("in", param)
out = mod.output("out", param)
var = mod.var("v", param)
mod.wire(var, in_)
mod.wire(out, var * 2)

Here is generated SystemVerilog:

module mod #(parameter P = 4'h4)
(
  input logic [P-1:0] in,
  output logic [P-1:0] out
);

logic  [P-1:0] v;
assign v = in;
assign out = v * 4'h2;
endmodule   // mod

Packed Struct and Bundles

Packed Struct

kratos allows to use packed struct in a limited ways. For now you can only use it in ports declaration.

To create a packed struct, simply do by calling kratos.PackedStruct constructor. For instance, if you want to create a struct called “config_data” which has two members (16-bit wide and unsigned), you can do

struct = PackedStruct("config_data", [("read", 16, False),
                                      ("data", 16, False)])

To use it in your generator, you can pass the definition into the normal call [gen].input() or [gen].output. You can then use the name to directly refer the members. For instance, to use the config_data we defined above, we can do something like below, where we create a module to slice the "data" from the input port.

class Mod(Generator):
    def __init__(self):
        super().__init__("mod")
        self.input("in", struct)
        self.output("out", 16)
        self.wire(self.ports["out"], self.ports["in"]["data"])

To generate the packed struct information, you can pass in extract_struct=True in the verilog function call.

mod = Mod()
mod_src, struct_def = verilog(mod, extra_struct=True)

Port Bundles

Similar to pymtl and Chisel, kratos allows you to create arbitrary port bundles with arbitrary direction within it. To create a bundle definition, you need to subclass the PortBundle class like the following:

class Test(PortBundle):
    def __init__(self):
        super().__init__()
        self.input("a", 1)
        self.output("b", 1)

The input() and ouput() interfaces are the same as that of Generator. To add a port bundle to the generator, you can do

self.port_bundle("in_port", Test())

where "in_port" is the bundle port name. Notice that we need to instantiate the object. You can also call flip to flip the port direction in place. For instance, you can do something like this:

p = self.port_bundle("out_port", Test().flip())

The wiring process is the same as as the packed struct. To access a port bundle member, you can either access via [], . (such as p.a), or through [gen].ports.p.a

When to use packed sturct and when to use port bundles

Keep in mind that in SystemVerilog there is no correspondence of a port bundle. That means the port bundle will be flattened into normal ports (the Python front-end does the job for you). As a result, the generated SystemVerilog code may not be that readable. The naming scheme is {bundle_name}_{member_name}.

The rule of thumb is that if you want to have a mixture of input and output in your struct, use port bundle, otherwise use packed struct.

If you want better generated SystemVerilog while using port bundles, it is highly recommended to use interface instead. It will be compiled to SystemVerilog interface instead, which offers better functionality than port bundles. You can check out more details, see Interfacce.

Note

There is a pass called change_port_bundle_struct that can convert port bundles into a packed struct. The only condition is that all the ports in the bundle have to be the same direction.

Attributes in Kratos’s IR

User annotated attributes is very helper to feed additional information to the passes, allowing more complex passes. Kratos allows you to embedded a string as an attribute to any IR nodes. Here is an example how to create an Attribute and then annotate the structural wire assignment.

Attributes in Python

Generator definition:

class PassThroughMod(Generator):
    def __init__(self, is_clone: bool = False):
        super().__init__("mod1", True, is_clone)
        self.in_ = self.port("in", 1, PortDirection.In)
        self.out_ = self.port("out", 1, PortDirection.Out)
        self.wire(self.out_, self.in_)

Annotation class and testing:

mod = PassThroughTop()
stmt = mod.get_stmt_by_index(0)

class TestAttribute(Attribute):
    def __init__(self):
        super().__init__()
        self.value = 42

stmt.add_attribute(TestAttribute())

assert len(mod.get_stmt_by_index(0).get_attributes()) > 0
attr = mod.get_stmt_by_index(0).get_attributes()[0].get()
assert attr.value == 42

Notice that get() call is necessary to obtain the Python object.

Attributes in C++

The C++ Attribute object has a generic pointer you can use to retrieve your custom data. To help you facilitate the type casting, you can set the type string in type_str and use that to indicate what custom type it’s holding. If the attribute comes from Python, type_str will be "python".

Note

Due to the language different between C++ and Python, there are some limitation on how they should be used.

  1. All attributes are written in C++: you’re safe as long as you follow the usage of C++ attributes.

  2. All attributes are written in Python: you’re safe as long as you follow the usage of Python attributes.

  3. Attributes written in Python and consumed in C++ or verse versa: because Python and C++’s objects have different memory layout, it is very dangerous to communicate. To work around this, all the Attribute object have value_str attribute as string, you can use that to communicate between Python and C++. For instance. You can have

    class TestAttribute(Attribute):
        def __init__(self):
            super().__init__()
            self.value_str = "42"
    

Procedural Code Generation in Depth

Kratos allows you to construct complex expressions and statements programmatically. As hinted in Generator of Generators, the python free-style front-end uses the procedural code generation to support the Python-style codes.

Expressions

You can construct expression the same way you expect in Python or C++. You can reuse old expressions by adding more operators to them.

Expression Stacking

Some assignments may need complex expressions that span multiple variables. This is very straightforward in kratos since kratos’ expression is just an ordinary Python/C++ object.

For instance, if we want to have a reduce summation on a list variables, you can do this in Python

vars = []
for i in range(num_vars):
    vars.append(self.var("variable_{0}".format(i), width))

sum = vars[0]
for i in range(1, num_vars):
    sum = sum + vars[i]

output = self.var("output", width)
self.add_stmt(output.assign(sum))

In this example we create a list of variables that stored in vars with width. Then we use sum to create the sum reduction. In the end, we create a output variable and assign sum to the output using assign() function call. Notice that we add this assign statement into the top level (using self). We will cover more details about the assign statement below. The generated verilog looks like below for this example code block when width = 16 and num_vars = 4.

logic  [15:0] variable_0;
logic  [15:0] variable_1;
logic  [15:0] variable_2;
logic  [15:0] variable_3;
logic  [15:0] output;
assign output = ((variable_0 + variable_1) + variable_2) + variable_3;

Statements

Statements are the building blocks of kratos IR. Each statement object has it’s parent block. The parent can either be the generator or another statement. If it is generator, it has to be the following statement types - SequentialCodeBlock - CombinationalCodeBlock - AssignStmt

Note

If a AssignStmt’s parent is the generator, it will be a continuous assignment, i.e., assign var1 = var2. Due to the backend optimization, the assign statement may not be realized into the verilog code. You should use the debugger if you want to debug the optimization and verilog code generation.

To add a statement to the generator, you can use

[gen].add_stmt(stmt)

where [gen] can either be self in the generator or some generator object.

AssignStmt

AssignStmt is the mostly used statements. kratos provides assign function call to handle the directional assignment. As shown in the examples below, to create an AssignStmt, you can call

var_to.assign(var_from)

Where the var_from is assigned to var_to. Notice that kratos also provides finer control over the assignment type by passing additional flag:

var_to.assign(var_from, AssignmentType.Blocking)

This will create a blocking assignment. If you don’t provide the flag, kratos will determine the assignment type at compile time. Since the compiler is checking and validating the assignment type, it’s recommended to just leave it blank and let the compiler figure it out, unless you have some practical reasons.

SequentialCodeBlock

Kratos’s Python interface provides an easy way to create sequential code block. Similar to verilog, the sequential block needs a sensitivity list. The sensitivity list is constructed the same way as in the @always block. It’s in the format of List[Tuple[BlockEdgeType, Var]], i.e. a list of tuples. You can either use BlockEdgeType.Posedge or BlockEdgeType.Negedge for the first entry. The second entry is the variable/port defined in the generator. You can obtained a sequential block by calling sequential from the generator instance. For instance:

clk = self.clock("clk")
seq_block = self.sequential((posedge, clk))

This will produce the following verilog code:

input logic  clk
// ...
always @(posedge clk) begin
end

To add more statements to it, you can construct other types of statements and then call add_stmt(new_stmt), such as seq_block.add_stmt(new_stmt).

Note

  • By calling [gen].sequential(), we implicitly add the sequential block into the generator. As a result, you don’t have to call [gen].add_stmt(seq) to add to the generator.
  • All the assign statement in SequentialCodeBlock will be either converted or checked to make sure they’re all non-blocking assignments.

CombinationalCodeBlock

CombinationalCodeBlock is very similar to SequentialCodeBlock, except that they don’t need a sensitivity list. To construct one, you can call

comb_block = self.combinational()

Kratos will generate the following system verilog code:

always_comb begin
end

You can add statements the same as SequentialCodeBlock by calling add_stmt.

Note

  • By calling [gen].combinational(), we implicitly add the combinational block into the generator. As a result, you don’t have to call [gen].add_stmt(seq) to add to the generator.
  • All the assign statement in CombinationalCodeBlock will be either converted or checked to make sure they’re all blocking assignments.

SwitchStmt

Switch statement allows you to construct case blocks in verilog. Similar to C++ or verilog, you need to have a condition (target). In kratos, this should be either an expression or a port/variable. You can add a switch case by using add_switch_case(value, stmts) statement. You can provide None to value to specify the default case.

Here is an example on how can you can construct a switch statement:

var = self.var("value", 16)
var_1 = self.var("value1", 16)
var_2 = self.var("value2", 16)
stmt = SwitchStmt(var)
# you can use a single statement
stmt.case_(1, var_1.assign(1))
stmt.case_(2, var_2.assign(1))
# you can also pass in a list of statements
stmt.case_(None, [var_1.assign(0),
                  var_2.assign(0)])
# remember to add it to a either sequential or combinational code block!
# we re-use the sequential block we created above.
seq_block.add_stmt(stmt)

Here is the generated system verilog:

logic  [15:0] value;
logic  [15:0] value1;
logic  [15:0] value2;

always @(posedge clk) begin
  case (value)
    default: begin
      value1 <= 16'h0;
      value2 <= 16'h0;
    end
    16'h2: begin
      value2 <= 16'h1;
    end
    16'h1: begin
      value1 <= 16'h1;
    end
  endcase
end

IfStmt

Similar to the SwitchStmt, the IfStmt needs a condition/target as well. An IfStmt has two parts, the then body and else body. You can add statements to either body by calling add_then_stmt and add_else_stmt.

Here is an example on how to construct an IfStmt.

var = self.var("var", 1)
value = self.var("value", 1)

if_ = IfStmt(var == 0)
if_.then_(value.assign(1))
if_.else_(value.assign(0))

# remember to add it to a either sequential or combinational code block!
# we re-use the combinational block we created above.
comb_block.add_stmt(if_stmt)

Notice that by design choice kratos doesn’t override __eq__ in Python. Unless it’s changed you have to use eq function call.

Here is the generated verilog:

logic   value;
logic   var;
always_comb begin
  if (var == 1'h0) begin
    value = 1'h1;
  end
  else begin
    value = 1'h0;
  end
end

Note

If you have nested IfStmt, in some cases the compiler may do some optimization to optimize them away. Please refer to the passes to see more details.

Syntax sugars

Kratos provides some syntax sugar to make statement creations less verbose. You can call if_ and switch_ to create statements in a functional manner. Notice that if you call if_ and switch_ directly from combinational and sequential, the statements will be added to the always block automatically.

For assignments, you can use functional call the assign the values, such as var_to(var_src). Here are some examples on the syntax sugars:

mod = Generator("mod")
out_ = mod.var("out", 1)
in_ = mod.input("in", 1)
comb = mod.combinational()
comb.if_(in_ == 1).then_(out_(0)).else_(out_(1))

This gives us

module mod (
  input logic  in
);

logic   out;
always_comb begin
  if (in == 1'h1) begin
    out = 1'h0;
  end
  else out = 1'h1;
end
endmodule   // mod

Here is an example for sequential block

mod = Generator("mod")
out_ = mod.var("out", 1)
in_ = mod.input("in", 1)
clk = mod.clock("clk")
comb = mod.sequential((posedge, clk))
comb.switch_(in_).case_(1, out_(1)).case_(0, out_(0))

This gives us

module mod (
  input logic  clk,
  input logic  in
);

logic   out;

always_ff @(posedge clk) begin
  unique case (in)
    1'h0: out <= 1'h0;
    1'h1: out <= 1'h1;
  endcase
end
endmodule   // mod

Comments

Almost every statement in kratos have an attribute called comment, you can set it any comment you want. It will be generated as a comment above the statement. For instance:

stmt = a.assign(b)
self.add_stmt(stmt)
stmt.comment = "this is a comment"
a.comment = "this is another comment"

When you’re using always_comb or always_ff function, you don’t have access to the stmt object. In this case, you can use comment() function. For instance,

def code(self):
    comment("Another comment")
    self._out3 = self._in

Finite State Machine

FSM in kratos is a first-class object, just like variables or ports. This design choice is made to help engineers to design complex FSM with ease.

Create a FSM

Lets look at the following code example

mod = Generator("mod", debug=True)
out_ = mod.output("out", 2)
in_ = mod.input("in", 2)
# fsm requires a clk and async rst
mod.clock("clk")
mod.reset("rst")
# add a dummy fsm
fsm = mod.add_fsm("Color")
# add outputs
fsm.output(out_)
# add states
red = fsm.add_state("Red")
blue = fsm.add_state("Blue")
# set the state transition
red.next(red, in_ == 0)
red.next(blue, in_ == 1)
blue.next(red, in_ == 1)
# fill in outputs
red.output(out_, 2)
blue.output(out_, 1)
# set the start case
fsm.set_start_state("Red")

First, we create a FSM called "Color" using [gen].add_fsm(), which returns an FSM object. By default, it searches for clock and async reset signal in the generator. If the generator has multiple clocks/reset, you can provide the variable in [gen].add_fsm() (see API for more information).

Then, we specify the outputs by calling fsm.output(). All the outputs have to be fully specified. This allows Kratos to check the completeness of the FSM.

You can add a state by calling fsm.add_state(state_name). It will return an object that represent the state. You can describe the state transition by calling state.next(next_state, condition), where next_state can either be a str or state object. You also need to fully specify the outputs for each output variable, using state.output(output_var, value). If the output value is not changed, you can use None as value.

By default, the start state is the first state in alphabetical order. You can set the start state using fsm.set_start_state(state), where state can either be a str or state object.

Here is the generated SystemVerilog code. Notice that all the output code blocks are named to help you debug in simulation.

module mod (
  input logic  clk,
  input logic [1:0] in,
  output logic [1:0] out,
  input logic  rst
);

typedef enum {
  Blue = 1'h0,
  Red = 1'h1
} Color_state;
Color_state   Color_current_state;
Color_state   Color_next_state;

always @(posedge clk, posedge rst) begin
  if (rst) begin
    Color_current_state <= Red;
  end
  else Color_current_state <= Color_next_state;
end
always_comb begin
  unique case (Color_current_state)
    Blue: if (in == 2'h1) begin
      Color_next_state = Red;
    end
    Red: if (in == 2'h1) begin
      Color_next_state = Blue;
    end
    else if (in == 2'h0) begin
      Color_next_state = Red;
    end
  endcase
end
always_comb begin
  unique case (Color_current_state)
    Blue: begin :Color_Blue_Output
        out = 2'h1;
      end
    Red: begin :Color_Red_Output
        out = 2'h2;
      end
  endcase
end
endmodule   // mod

How to debug FSM

Kratos has built-in ability to output state transition diagram and output table. You can obtain the diagram using fsm.dot_graph() or fsm.dot_graph(filename). If filename is not provided, a string version will be returned. dot_graph() returns a standard dot graph that can be converted into images via dot. You can also use fsm.output_table() to obtain the table for each state’s output. Again, providing the function with a file name will save the output to a file.

Here is the state transition graph generated from the example

_images/fsm.svg

As always, if you set the debug in the generator to be true, Kratos will generate full trace of each statements back to the original python functions. In addition, it utilizes named block to group outputs signals together in generated SystemVerilog. This will make debugging with waveform much easier.

Access State Variables

Because Kratos allows users to modify FSM at any time, generally speaking the realization of FSM happens at the very end. However, sometimes users may want to access to state variable when calculating other outputs. To no so, you can realize the FSM by hand using fsm.realize() function. Once it’s realized fsm.current_sate becomes accessible. To ensure type safety, you need to use the enum type to create your variable. An example is shown below:

mod = Generator("mod", debug=True)
out_ = mod.output("out", 2)
in_ = mod.input("in", 2)
# fsm requires a clk and async rst
clk = mod.clock("clk")
rst = mod.reset("rst")
# add a dummy fsm with reset low
fsm = mod.add_fsm("Color", reset_high=False)
# realize fsm now
fsm.realize()
current_state = fsm.current_state
# create an enum var based on current_state
state_enum = current_state.enum_type()
# can create a variable from the enum definition
# notice that variable s will be optimized away if not used
s = mod.enum_var("s", state_enum)
c = mod.var("counter", 1)

@always((posedge, clk), (negedge, rst))
def counter():
    if rst.r_not():
        c = 0
    elif current_state == state_enum.Red:
        c = c + 1

mod.add_code(counter)

In the example, we realize the FSM and then obtain the current state variable. We can get the enum type by calling current_state.enum_type(). After that, you can use the enum variable when comparing with the enum values defined by your FSM. You can use . notation to access the enum value from the enum types. Notice that you can use the state_enum, which is an enum type to create enum variable with that type.

Warning

Once the FSM is realized by the user, any changes to the FSM may have unexpected behavior.

Moore machine to Mealy

Kratos offers a simple way to convert Moore machine (the default) one into a Mealy machine. To avoid state naming confusion, all states are kept the same all the outputs are handled through functions inside the state transition block.

To set the FSM to Mealy machine, simply do fsm.is_moore = False to convert it into a Mealy machine. You’re free to change it at any time before the FSM hits realize_fsm pass.

Coming Soon

  1. Formal verification on FSM: both general cases and per-design
  2. Directly specify Mealy machine.

Kratos Functions

Functions in general have many benefits:

  • It allows users to re-use existing code, thus improving debuggability
  • It increases design readability and allows abstraction

Kratos has first-class support for functions that can turn python functions into a nice looking system verilog functions, while keeping the same semantics as in Python. The usage is very similar to how free-style code blocks works, all you need is to mark your function with @function, which can be import from from kratos.func import function. All the features in free-style code such as static-elaboration is supported in kratos’ functions.

Usage

Here is an example of how to use functions. Notice that you can only call the function inside a code block (this rule applies to both free-style code blocks and procedural code generation.)

from kratos.func import function

class Mod(Generator):
    def __init__(self):
        super().__init__("mod")
        self._in = self.input("in", 2)
        self._out = self.output("out", 2)
        self._out2 = self.output("out2", 2)

        self.add_code(self.code)

    @function
    def update_out(self, value, predicate):
        self._out2 = value
        if predicate:
            return value + self._in
        else:
            return value

    def code(self):
        # because the types are inferred
        # implicit const conversion doesn't work here
        self._out = self.update_out(self._in, const(1, 1))

Notice that we can directly call the function as self.update_out() in the code block. This is the same semantics as normal Python function calls. Below is the generated SystemVerilog.

module mod (
  input logic [1:0] in,
  output logic [1:0] out,
  output logic [1:0] out2
);

function update_out(
  input logic [1:0] value,
  input logic  predicate
);
begin
  out2 = value;
  if (predicate) begin
    return value + in;
  end
  else return value;
end
endfunction
always_comb begin
  out = update_out (in, 1'h1);
end
endmodule   // mod

Debug

Kratos will produce source map for debugging function definitions, the same way as free-style code blocks. You can use kratos-debug to view the source mapping.

Type Deduction and limitations

Kratos is type-safe by design. As a result, all the function call will be type-checked at runtime. Similar to modern C++’s type deduction, kratos can deduct types based on function invocations, which removes the requirement of specifying types in the function definition. Kratos will inspect the arguments in the function invocation and inspect the types of each arguments and use that to construct the function interface. This is convenient for users in most cases. However, that also requires to to specify the type for constants as well. As shown in the example above, you have to call const() to construct a constant.

DPI in Kratos

Direct Programming Interface (DPI) is an very powerful tool that allows foreign Programming languages to be run in the simulator. DPI has been used for rapid prototyping and debugging. Kratos supports DPI in two ways:

  1. C/C++. This is the default functionality shipped with kratos.
  2. Python code. This can be installed from kratos-dpi. You can run any arbitrary Python code in lieu of native C/C++ code.

C/C++ Interface

You can declare a function declaration in the following way:

from kratos.func import dpi_function

 @dpi_function(2)
 def add(arg0, arg1):
     pass

@dpi_function(width)` denotes the return size. Notice that the ``width support is still experimental due to the inconsistency between verilator and commercial simulators.

After declaration, you can use it in any always block, as a normal function call, as shown below:

class Mod(Generator):
    def __init__(self):
        super().__init__("mod", debug=True)
        self._in = self.input("in", 2)
        self._out = self.output("out", 2)

        self.add_code(self.code)

    def code(self):
        # because the types are inferred
        # implicit const conversion doesn't work here
        self._out = add(self._in, const(1, 2))

You have to make sure to implement the function in C/C++ with the following function signature:

int add(int arg0, int arg1);

If you are using C++, extern is required.

Python Interface

Once you’ve installed kratos-dpi, you can run any arbitrary Python function with DPI, as shown below:

from kratos_dpi import dpi_python

@dpi_python(16)
def test_a(a, b):
    return a + b

Again, you can use it in any always block as a function call. However, kratos-dpi needs to compile your Python code into a shared library. You need to call dpi_compile to compile all your Python DPI functions into a shared object, such as:

lib_path = dpi_compile("add_dpi", "output_dir")

You need to provide a working directory for kratos-dpi to compile objects. The function call returns the path for the shared object.

SystemVerilog Types

Kratos follows the SystemVerilog spec about the types. Currently it offers two different ways to deal with function argument types:

  1. Logic based type interface.
  2. Native C types.

You can choose which one to have by using int_dpi_interface=True in verilog() function. If the option is set to True, native C types will be used. It will perform a ceiling on each argument and output char, short int, int, and long int as the C interface. If the option is set to False, logic will be used and users are responsible to handle the svLogic type conversion by themselves. You can refer to svdpi.h header to see how to conversion works.

Note

If you are using Python interface, you’re required to use int_dpi_interface=True.

Work in Progress

  1. Integrate with simulators to load the shared library.

Use Kratos as a Backend

The front end Python package is the of the best examples on how to use Kratos’ backend API. In particular, generator.py shows how to wrap _kratos.Generator with a Python class. pyast.py shows how to to use ast module to convert Python code into Kratos’s IR.

In general unless you’re very familiar with the raw _kratos bindings, you should use as much kratos wrappers as possible.

How to specify source mapping

Every IR element in Kratos has add_fn_ln functions which take a pair of string and unsigned integer (filename and line number). The line number reported from inspect module starts from 1, which is consistent from with the Visual Studio Code Debugger.

When dumping the debug database, Kratos search the filename amd line number from the source list starting from index 0. That means that you have to insert your own DSL’s source code location in the first entry. To do so, you can call something like

stmt.add_fn_ln(("/home/keyi/kratos/example/example.py", 10), True))

The extra True will ensure inserting at the front.

Note

filename passed in has to be absolute path.

How to specify context/scope variables

Context/scope variables are variables that will be displayed during the debugging once a breakpoint is hit. There are two different type of variables:

  1. Local variables
  2. Generator variables

Local variables are the ones accessible when the IR node is instantiated. You can think as the locals() when a particular variable or statement is generated. Local variables will be shown in the local scope in the debugger.

Generator variables are these accessible through self.XX, where XX is the attribute name. Generator variable will be shown in the self object in the debugger. You can use setattr() to set Generator instance to dynamically add the attributes.

You can use kratos.add_scope_context to set the context/scope variables by providing the statement and locals.

Note

Combined with local and generator variables, Kratos aims to capture the generation environment as if it’s running in Python. To do so, it will store any int, flaot, str, and bool variable as constants in the debug database. These values will be “replayed” during Verilog simulator to emulate the sense of source-level debugging.

How to store the debug information

When you call verilog function, you can specify debug_db_filename as a positional argument. This will dump the design infortion to the file.

Note

You have to make sure to turn the debug on for any modules you are interested in. By default the debug option is off for every generator instance. You can either do [gen].debug = True, or turn the global debug on (same as -g in gdb) by calling kratos.set_global_debug(True).

You should see tests/test_debug.py for more usage information.

Interfacce

Kratos supports full features of SystemVerilog interface, includes modport. You can create an interface class and use standard OOP techniques available in Python.

Create an interface

First, you need to define an interface class definition. Image we have a buswhere master and slave communicated to each other: he master needs to write/read configuration data from the slave. To define the bus, we have

class ConfigInterface(Interface):
    def __init__(self):
        Interface.__init__(self, "Config")
        width = 8
        # local variables
        read = self.var("read_data", width)
        write = self.var("write_data", width)
        r_en = self.var("read_en", 1)
        w_en = self.var("write_en", 1)
        # common ports
        clk = self.clock("clk")

        # define master -> slave ports
        # and slave -> master ports
        m_to_s= [write, r_en, w_en]
        s_to_m = [read]

        # define master and slave
        self.master = self.modport("Master")
        self.slave = self.modport("Slave")
        for port in m_to_s:
            self.master.set_output(port)
            self.slave.set_input(port)
        for port in s_to_m:
            self.master.set_input(port)
            self.slave.set_output(port)

        # both of them need clock
        self.master.set_input(clk)
        self.slave.set_input(clk)

In the example above, we have Master and Slave connected via a bus using modport. To save our efforts of typing, we group ports together into m_to_s and s_to_m. This also allows better introspection for application-level passes.

To use them, we need some implementation for both master and slave. We will use some dummy logic to illustrate how to use the interface and interact with our logic. To instantiate an interface, you need the following function call from the generator object:

def interface(self, interface, name, is_port: bool = False):

By default the interface bus will be instantiated as local variable, you can set is_port to True to make it a port.s

Here is the code for the master:

class Master(Generator):
    def __init__(self):
        Generator.__init__(self, "Master")

        # instantiate the interface
        self.bus = self.interface(config.master, "bus",
                                  is_port=True)

        # some logic to loop the read and write
        # cycle
        self.counter = self.var("counter", 8)

        # we wire counter value to the write data
        self.wire(self.bus.write_data, self.counter)

        # always_ff on the posedge of clock from the interface
        @always_ff((posedge, self.bus.clk))
        def logic():
            if self.counter % 4 == 0:
                self.bus.r_en = 1
                self.bus.w_en = 0
            elif self.counter % 4 == 1:
                self.bus.r_en = 0
                self.bus.w_en = 1
            else:
                self.bus.r_en = 0
                self.bus.w_en = 0
            self.counter = self.counter + 1

        self.add_always(logic)

Notice that we use a counter to control the read and write enable signal, as well as the write data. Here is the generated SystemVerilog if we call verilog(Master(), filename="master.sv").

module Master (
  Config.Master bus
);

logic [7:0] counter;
assign bus.write_data = counter;

always_ff @(posedge bus.clk) begin
  if ((counter % 8'h4) == 8'h0) begin
    bus.r_en <= 1'h1;
    bus.w_en <= 1'h0;
  end
  else if ((counter % 8'h4) == 8'h1) begin
    bus.r_en <= 1'h0;
    bus.w_en <= 1'h1;
  end
  else begin
    bus.r_en <= 1'h0;
    bus.w_en <= 1'h0;
  end
  counter <= counter + 8'h1;
end
endmodule   // Master

Note

Notice that Kratos will not generate interface if it is used as a modport. This is by design so that we can re-use the interface designed elsewhere such as UVM test files. However, Kratos will generate the interface definition if the entire interface is being used, as we shall see later.

Here is the Python code for the slave:

class Slave(Generator):
    def __init__(self):
        Generator.__init__(self, "Slave")

        # instantiate the interface
        self.bus = self.interface(config.slave, "bus",
                                  is_port=True)

        self.value = self.var("value", 8)

        # just read and write out
        @always_ff((posedge, self.bus.clk))
        def logic():
            if self.bus.r_en:
                self.value = self.bus.write_data
            elif self.bus.w_en:
                self.bus.read_data = self.value

        self.add_always(logic)

Here is generated the SystemVerilog for slave by calling verilog(Slave(), "slave.sv"):

module Slave (
  Config.Slave bus
);

logic [7:0] value;

always_ff @(posedge bus.clk) begin
  if (bus.r_en) begin
    value <= bus.write_data;
  end
  else if (bus.w_en) begin
    bus.read_data <= value;
  end
end
endmodule   // Slave

Now let’s see how we can connect these two generators together:

class Top(Generator):
    def __init__(self):
        Generator.__init__(self, "Top")

        # instantiate master and slave
        self.master = Master()
        self.slave = Slave()
        self.add_child("master", self.master)
        self.add_child("slave", self.slave)

        # clock will be from outside
        clk = self.clock("clk")

        # instantiate the interface bus
        # notice that we're using config, not the modport
        # version such as config.master
        bus = self.interface(config, "bus_top")

        # just need to wire things up
        self.wire(bus.clk, clk)
        self.wire(self.master.bus, bus)
        self.wire(self.slave.bus, bus)
        # the following also works
        # self.wire(self.master.bus, bus.Master)
        # self.wire(self.slave.bus, bus.Slave)

Notice that we instantiate the top level interface bus here as bus = self.interface(config, "bus_top"). Since it’s top-level, it is not a port (default is not). When wiring with the child instances, we can just call self.wire(self.master.bus, bus). Kratos is smart enough to figure out you’re wiring modport interface. If you want consistence semantics as the one from SystemVerilog, you can also do self.wire(self.master.bus, bus.Master), which also works. Since the interface takes clk as an input, we need to wire the signal from the top level, i.e., self.wire(bus.clk, clk). Kratos will figure out the proper port directions.

Here is the generated SystemVerilog. Since we are generating interface at the top level, the interface definition will be generated:

interface Config(
  input logic clk
);
  logic r_en;
  logic [7:0] read_data;
  logic w_en;
  logic [7:0] write_data;
  modport Master(input clk, input read_data, output r_en, output w_en, output write_data);
  modport Slave(input clk, input r_en, input w_en, input write_data, output read_data);
endinterface

// Master and Slave module definition omitted

module Top (
  input logic clk
);

Config bus_top (
  .clk(clk)
);

Master master (
  .bus(bus_top.Master)
);

Slave slave (
  .bus(bus_top.Slave)
);

endmodule   // Top

Kratos API Reference

class kratos.Generator(name: str, debug: bool = False, is_clone: bool = False, internal_generator=None)
add_always(fn, comment='', label='', sensitivity=None, fn_ln=None, unroll_for=False, ssa_transform=False, **kargs)
add_attribute(attr)
add_child(instance_name: str, generator: kratos.generator.Generator, comment='', python_only=False, **kargs)
add_child_generator(instance_name: str, generator: kratos.generator.Generator, comment='', python_only=False, **kargs)
add_code(fn, comment='', label='', sensitivity=None, fn_ln=None, unroll_for=False, ssa_transform=False, **kargs)
add_fsm(fsm_name: str, clk_name=None, reset_name=None, reset_high=True)
add_stmt(stmt, add_ln_info=True)
child_generator()
static clear_context()
static clear_context_hash()
clock(name, is_input=True)
clock_en(name, is_input=True)
classmethod clone(**kargs)
combinational()
classmethod create(**kargs)
debug
def_instance

The definition instance of this generator. It can be itself or the clone reference :return: definition instance

enum(name: str, values: Dict[str, int], width=None)
enum_var(name: str, def_: _kratos.Enum)
external

External module typically is used when importing external verilog files. If set from user, all the passes and code gen will skip this generator definition. :return: True if it’s an external generator

find_attribute(func)
static from_verilog(top_name: str, src_file: str, lib_files: List[str], port_mapping: Dict[str, _kratos.PortType])
static get_context()
get_marked_stmt(name)
get_stmt_by_index(index)
get_var(name)
initialize_clone()
input(name, width: Union[int, _kratos.Param, _kratos.Enum, _kratos.PackedStruct], port_type: _kratos.PortType = <PortType.Data: 0>, is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Port
instance_name

Instance name of a generator. It has to be unique within a parent generator. :return: the instance name of the generator

interface(interface, name, is_port: bool = False)
internal_generator
is_cloned
is_stub

If a generator is mark as a stub, most of the passes won’t touch it and it’s the user’s responsibility to keep track of it. Kratos will attempt to zero out the stub outputs. :return: True if it’s a stub

mark_stmt(name: str, stmt)
name

Generator name usually corresponds to the name of the module. However, if unification happens, its verilog name will change. :return: The name of the generator

output(name, width: Union[int, _kratos.Param, _kratos.Enum, _kratos.PackedStruct], port_type: _kratos.PortType = <PortType.Data: 0>, is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Port
param(name: str, width: int = 32, value=None, is_signed: bool = False, initial_value=None, is_raw_type: bool = False) → _kratos.Param
param_from_def(param: _kratos.Param, name=None)
parameter(name: str, width: int = 32, value=None, is_signed: bool = False, initial_value=None, is_raw_type: bool = False) → _kratos.Param
port(name: str, width: Union[int, _kratos.Param, _kratos.Enum], direction: _kratos.PortDirection, port_type: _kratos.PortType = <PortType.Data: 0>, is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Port
port_bundle(bundle_name, bundle: kratos.ports.PortBundle)
port_from_def(port: _kratos.Port, name='', check_param: bool = True)
property(property_name: str, seq)
reg_enable(var_name, var, en, clk=None)
reg_init(var_name, var, clk=None, reset=None, init_value=0)
reg_next(var_name, var, clk=None)
remove_child_generator(generator)
remove_port(port_name)
remove_stmt(stmt)
remove_var(var_name)
replace(child_name: str, new_child: kratos.generator.Generator)
reset(name, is_input=True, is_async=True, active_high=None)
sequential(*sensitivity_list)
stmts_count
var(name: str, width: Union[int, _kratos.Param, _kratos.Enum, _kratos.PackedStruct], is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Var
var_from_def(var: _kratos.Var, name)
var_packed(name: str, struct_packed: _kratos.PortPackedStruct)
wire(var_to, var_from, attributes: Union[List[_kratos.passes.Attribute], _kratos.passes.Attribute] = None, comment='', locals_=None, fn_ln=None, additional_frame=0, no_fn_ln=False)
class kratos.PortType

Members:

Clock

AsyncReset

ClockEnable

Data

Reset

AsyncReset = <PortType.AsyncReset: 2>
Clock = <PortType.Clock: 1>
ClockEnable = <PortType.ClockEnable: 4>
Data = <PortType.Data: 0>
Reset = <PortType.Reset: 3>
name
value
class kratos.PortDirection

Members:

In

Out

InOut

In = <PortDirection.In: 0>
InOut = <PortDirection.InOut: 2>
Out = <PortDirection.Out: 1>
name
value
class kratos.EventEdgeType

Members:

Posedge

Negedge

Negedge = <EventEdgeType.Negedge: 1>
Posedge = <EventEdgeType.Posedge: 0>
name
value
kratos.verilog(generator: kratos.generator.Generator, optimize_if: bool = True, optimize_passthrough: bool = True, optimize_fanout: bool = True, optimize_bundle: bool = True, reorder_stmts: bool = False, check_active_high: bool = True, debug_fn_ln: bool = False, additional_passes: Dict[KT, VT] = None, int_dpi_interface: bool = True, remove_assertion: bool = False, check_inferred_latch: bool = True, check_multiple_driver: bool = True, check_combinational_loop: bool = True, insert_pipeline_stages: bool = False, filename: str = None, insert_debug_info: bool = False, insert_verilator_info: bool = False, check_flip_flop_always_ff: bool = True, remove_unused: bool = True, merge_const_port_assignment: bool = True, debug_db_filename: str = '', ssa_transform: bool = False, use_parallel: bool = True, track_generated_definition: bool = False, contains_event: bool = False, lift_genvar_instances: bool = False, fix_port_legality: bool = False, dead_code_elimination: bool = False, collect_pass_perf: bool = False, codegen_options: _kratos.SystemVerilogCodeGenOptions = None)
kratos.const(value: Union[str, int], width: int = 32, is_signed: bool = False)
kratos.is_valid_verilog(*args, **kwargs)

Overloaded function.

  1. is_valid_verilog(arg0: str) -> bool

Check if the verilog doesn’t have any syntax errors. Notice that you have to have either verilator or iverilog in your $PATH to use this function

  1. is_valid_verilog(arg0: Dict[str, str]) -> bool

Check if the verilog doesn’t have any syntax errors. Notice that you have to have either verilator or iverilog in your $PATH to use this function

exception kratos.VarException
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception kratos.StmtException
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class kratos.IRVisitor
visit_generator(self: _kratos.passes.IRVisitor, arg0: kratos::Generator) → None
visit_root(self: _kratos.passes.IRVisitor, arg0: kratos::IRNode) → None
class kratos.FSM
add_child_fsm(self: _kratos.FSM, arg0: _kratos.FSM) → None
add_state(*args, **kwargs)

Overloaded function.

  1. add_state(self: _kratos.FSM, arg0: str) -> kratos::FSMState
  2. add_state(self: _kratos.FSM, arg0: str, arg1: Tuple[str, int]) -> kratos::FSMState
current_state
dot_graph(*args, **kwargs)

Overloaded function.

  1. dot_graph(self: _kratos.FSM) -> str
  2. dot_graph(self: _kratos.FSM, arg0: str) -> None
fsm_name(self: _kratos.FSM) → str
get_all_child_fsm(self: _kratos.FSM) → List[_kratos.FSM]
get_state(self: _kratos.FSM, arg0: str) → kratos::FSMState
is_moore(self: _kratos.FSM) → bool
output(*args, **kwargs)

Overloaded function.

  1. output(self: _kratos.FSM, arg0: str) -> None
  2. output(self: _kratos.FSM, arg0: _kratos.Var) -> None
  3. output(self: _kratos.FSM, arg0: _kratos.Var, arg1: _kratos.Var) -> None
  4. output(self: _kratos.FSM, arg0: str, arg1: _kratos.Var) -> None
output_table(*args, **kwargs)

Overloaded function.

  1. output_table(self: _kratos.FSM) -> str
  2. output_table(self: _kratos.FSM, arg0: str) -> None
outputs(self: _kratos.FSM) → Dict[_kratos.Var, _kratos.Var]
realize(self: _kratos.FSM) → None
set_moore(self: _kratos.FSM, arg0: bool) → None
set_reset_high(self: _kratos.FSM, arg0: bool) → None
set_start_state(*args, **kwargs)

Overloaded function.

  1. set_start_state(self: _kratos.FSM, arg0: str) -> None
  2. set_start_state(self: _kratos.FSM, arg0: kratos::FSMState) -> None
  3. set_start_state(self: _kratos.FSM, arg0: str, arg1: Tuple[str, int]) -> None
  4. set_start_state(self: _kratos.FSM, arg0: kratos::FSMState, arg1: Tuple[str, int]) -> None
class kratos.FSMState
name
next(*args, **kwargs)

Overloaded function.

  1. next(self: _kratos.FSMState, arg0: _kratos.FSMState, arg1: _kratos.Var) -> None
  2. next(self: _kratos.FSMState, arg0: _kratos.FSMState, arg1: _kratos.Var, arg2: Tuple[str, int]) -> None
output(*args, **kwargs)

Overloaded function.

  1. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: _kratos.Var) -> None
  2. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: int) -> None
  3. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: _kratos.Var, arg2: Tuple[str, int]) -> None
  4. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: int, arg2: Tuple[str, int]) -> None
kratos.initial(fn)
kratos.final(fn)
class kratos.Sequence
imply(self: _kratos.Sequence, arg0: _kratos.Var) → _kratos.Sequence
next(self: _kratos.Sequence) → _kratos.Sequence
wait(*args, **kwargs)

Overloaded function.

  1. wait(self: _kratos.Sequence, arg0: int) -> _kratos.Sequence
  2. wait(self: _kratos.Sequence, arg0: int, arg1: int) -> _kratos.Sequence
class kratos.TestBench(top_name: str = 'TOP')
add_always(fn, comment='', label='', sensitivity=None, fn_ln=None, unroll_for=False, ssa_transform=False, **kargs)
add_attribute(attr)
add_child(instance_name: str, generator: kratos.generator.Generator, comment='', python_only=False, **kargs)
add_child_generator(instance_name: str, generator: kratos.generator.Generator, comment='', python_only=False, **kargs)
add_code(fn, comment='', label='', sensitivity=None, fn_ln=None, unroll_for=False, ssa_transform=False, **kargs)
add_fsm(fsm_name: str, clk_name=None, reset_name=None, reset_high=True)
add_stmt(stmt, add_ln_info=True)
child_generator()
static clear_context()
static clear_context_hash()
clock(name, is_input=True)
clock_en(name, is_input=True)
classmethod clone(**kargs)
combinational()
classmethod create(**kargs)
debug
def_instance

The definition instance of this generator. It can be itself or the clone reference :return: definition instance

enum(name: str, values: Dict[str, int], width=None)
enum_var(name: str, def_: _kratos.Enum)
external

External module typically is used when importing external verilog files. If set from user, all the passes and code gen will skip this generator definition. :return: True if it’s an external generator

find_attribute(func)
static from_verilog(top_name: str, src_file: str, lib_files: List[str], port_mapping: Dict[str, _kratos.PortType])
static get_context()
get_marked_stmt(name)
get_stmt_by_index(index)
get_var(name)
initialize_clone()
input(name, width: Union[int, _kratos.Param, _kratos.Enum, _kratos.PackedStruct], port_type: _kratos.PortType = <PortType.Data: 0>, is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Port
instance_name

Instance name of a generator. It has to be unique within a parent generator. :return: the instance name of the generator

interface(interface, name, is_port: bool = False)
internal_generator
is_cloned
is_stub

If a generator is mark as a stub, most of the passes won’t touch it and it’s the user’s responsibility to keep track of it. Kratos will attempt to zero out the stub outputs. :return: True if it’s a stub

mark_stmt(name: str, stmt)
name

Generator name usually corresponds to the name of the module. However, if unification happens, its verilog name will change. :return: The name of the generator

output(name, width: Union[int, _kratos.Param, _kratos.Enum, _kratos.PackedStruct], port_type: _kratos.PortType = <PortType.Data: 0>, is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Port
param(name: str, width: int = 32, value=None, is_signed: bool = False, initial_value=None, is_raw_type: bool = False) → _kratos.Param
param_from_def(param: _kratos.Param, name=None)
parameter(name: str, width: int = 32, value=None, is_signed: bool = False, initial_value=None, is_raw_type: bool = False) → _kratos.Param
port(name: str, width: Union[int, _kratos.Param, _kratos.Enum], direction: _kratos.PortDirection, port_type: _kratos.PortType = <PortType.Data: 0>, is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Port
port_bundle(bundle_name, bundle: kratos.ports.PortBundle)
port_from_def(port: _kratos.Port, name='', check_param: bool = True)
property(property_name: str, seq)
reg_enable(var_name, var, en, clk=None)
reg_init(var_name, var, clk=None, reset=None, init_value=0)
reg_next(var_name, var, clk=None)
remove_child_generator(generator)
remove_port(port_name)
remove_stmt(stmt)
remove_var(var_name)
replace(child_name: str, new_child: kratos.generator.Generator)
reset(name, is_input=True, is_async=True, active_high=None)
sequential(*sensitivity_list)
stmts_count
var(name: str, width: Union[int, _kratos.Param, _kratos.Enum, _kratos.PackedStruct], is_signed: bool = False, size: Union[int, List[T], Tuple] = 1, packed: bool = False, explicit_array: bool = False) → _kratos.Var
var_from_def(var: _kratos.Var, name)
var_packed(name: str, struct_packed: _kratos.PortPackedStruct)
wire(var_to, var_from, attributes: Union[List[_kratos.passes.Attribute], _kratos.passes.Attribute] = None, comment='', locals_=None, fn_ln=None, additional_frame=0, no_fn_ln=False)
kratos.assert_(expr)
kratos.delay(num, stmt, lhs=True)
kratos.enable_runtime_debug(generator: kratos.generator.Generator)
kratos.enum(name, definition, width=None)
kratos.clear_context()
kratos.always_comb(fn)
kratos.always_ff(*sensitivity)
kratos.always_latch(fn)
kratos.has_enum(name)
kratos.always(fn)
class kratos.CombinationalCodeBlock(generator, debug_frame_depth: int = 4, general_purpose: bool = False)
add_attribute(attr)
add_stmt(stmt, add_fn_ln: bool = True, depth=2)
if_(predicate: _kratos.Var) → kratos.stmts.IfStmt
remove_stmt(stmt)
stmt()
switch_(predicate: _kratos.Var) → kratos.stmts.SwitchStmt
class kratos.SequentialCodeBlock(generator, sensitivity_list, debug_frame_depth: int = 4)
add_attribute(attr)
add_stmt(stmt, add_fn_ln: bool = True, depth=2)
if_(predicate: _kratos.Var) → kratos.stmts.IfStmt
remove_stmt(stmt)
stmt()
switch_(predicate: _kratos.Var) → kratos.stmts.SwitchStmt
class kratos.SwitchStmt(predicate: _kratos.Var)
add_scope_variable(name, value, is_var=False, override=False)
case_(cond: _kratos.Var, *args)
stmt()
class kratos.PackedStruct
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.PackedStruct, arg0: str, arg1: int) -> None
  2. add_attribute(self: _kratos.PackedStruct, arg0: str, arg1: int, arg2: bool) -> None
  3. add_attribute(self: _kratos.PackedStruct, arg0: str, arg1: _kratos.PackedStruct) -> None
attributes
external
struct_name
class kratos.Port
active_high
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
connected(self: _kratos.Port) → bool
connected_from(self: _kratos.Port) → Set[_kratos.Port]
connected_to(self: _kratos.Port) → Set[_kratos.Port]
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
port_direction
port_type
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class kratos.Var
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class kratos.IfStmt(predicate: _kratos.Var)
add_fn_ln(info)
add_scope_variable(name, value, is_var=False, override=False)
else_(*args)
else_body()
stmt()
then_(*args)
then_body()
class kratos.AssignmentType

Members:

Blocking

NonBlocking

Undefined

Blocking = <AssignmentType.Blocking: 0>
NonBlocking = <AssignmentType.NonBlocking: 1>
Undefined = <AssignmentType.Undefined: 2>
name
value
kratos.if_(predicate: _kratos.Var)
kratos.switch_(predicate: _kratos.Var)
class kratos.Attribute
static create(arg0: str) → _kratos.passes.Attribute
get(self: _kratos.passes.Attribute) → object
type_str
value_str
class kratos.PortBundle(debug=False)
clock(name, is_input=True)
flip()
input(name, width, is_signed=False, size=1, port_type=<PortType.Data: 0>)
output(name, width, is_signed=False, size=1, port_type=<PortType.Data: 0>)
reset(name, is_input=True)
class kratos.DebugDataBase
save_database(*args, **kwargs)

Overloaded function.

  1. save_database(self: _kratos.DebugDataBase, filename: str, override: bool) -> None
  2. save_database(self: _kratos.DebugDataBase, filename: str) -> None
set_break_points(self: _kratos.DebugDataBase, arg: _kratos.Generator) → None
set_variable_mapping(*args, **kwargs)

Overloaded function.

  1. set_variable_mapping(self: _kratos.DebugDataBase, mapping: Dict[_kratos.Generator, Dict[str, _kratos.Var]]) -> None
  2. set_variable_mapping(self: _kratos.DebugDataBase, mapping: Dict[_kratos.Generator, Dict[str, str]]) -> None
kratos.add_scope_context(stmt, _locals)
kratos.set_global_debug(value: bool)
class kratos.Interface
clock(self: _kratos.Interface, arg0: str) → str
has_port(self: _kratos.Interface, arg0: str) → bool
has_var(self: _kratos.Interface, arg0: str) → bool
input(self: _kratos.Interface, arg0: str, arg1: int, arg2: int) → str
modport(self: _kratos.Interface, arg0: str) → kratos::InterfaceModPortDefinition
output(self: _kratos.Interface, arg0: str, arg1: int, arg2: int) → str
port(*args, **kwargs)

Overloaded function.

  1. port(self: _kratos.Interface, arg0: str, arg1: int, arg2: int, arg3: _kratos.PortDirection) -> str
  2. port(self: _kratos.Interface, arg0: str, arg1: int, arg2: List[int], arg3: _kratos.PortDirection) -> str
  3. port(self: _kratos.Interface, arg0: str, arg1: int, arg2: List[int], arg3: _kratos.PortDirection, arg4: _kratos.PortType) -> str
reset(self: _kratos.Interface, arg0: str) → str
var(*args, **kwargs)

Overloaded function.

  1. var(self: _kratos.Interface, arg0: str, arg1: int, arg2: int) -> str
  2. var(self: _kratos.Interface, arg0: str, arg1: int, arg2: List[int]) -> str
  3. var(self: _kratos.Interface, arg0: str, arg1: int) -> str
class kratos.VarSlice
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
high
is_packed
low
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
parent_var
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sliced_by_var
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class kratos.VarVarSlice
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
high
is_packed
low
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
parent_var
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
slice_var
sliced_by_var
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class kratos.ParamType

Members:

RawType

Parameter

Enum

Integral

Enum = <ParamType.Enum: 2>
Integral = <ParamType.Integral: 0>
Parameter = <ParamType.Parameter: 1>
RawType = <ParamType.RawType: 3>
name
value
class kratos.Event
class kratos.Transaction
kratos.clog2(x: Union[int, _kratos.Var]) → Union[int, _kratos.Var]
kratos.reduce_add(*args)
kratos.reduce_and(*args)
kratos.reduce_mul(*args)
kratos.reduce_or(*args)
kratos.concat(*args)
kratos.ext(var, target_width)
kratos.comment(comment_str)
kratos.signed(var)
kratos.unsigned(var)
kratos.create_stub(generator, filename='')
kratos.resize(var, target_width)
class kratos.EventEdgeType

Members:

Posedge

Negedge

Negedge = <EventEdgeType.Negedge: 1>
Posedge = <EventEdgeType.Posedge: 0>
name
value
kratos.mux(cond, left, right)
kratos.ternary(cond, left, right)
class _kratos.AssertPropertyStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
property(self: _kratos.AssertPropertyStmt) → kratos::Property
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.AssertValueStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
value(self: _kratos.AssertValueStmt) → _kratos.Var
verilog_ln
class _kratos.AssignStmt

Assignment statement

add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
assign_type(self: _kratos.AssignStmt) → _kratos.AssignmentType
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
delay
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
has_delay
left
right
scope_context
set_assign_type(self: _kratos.AssignStmt, arg0: _kratos.AssignmentType) → None
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.AssignmentType

Members:

Blocking

NonBlocking

Undefined

Blocking = <AssignmentType.Blocking: 0>
NonBlocking = <AssignmentType.NonBlocking: 1>
Undefined = <AssignmentType.Undefined: 2>
name
value
class _kratos.AuxiliaryStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
aux(self: _kratos.AuxiliaryStmt) → _kratos.AuxiliaryType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.AuxiliaryType

Members:

Event

Event = <AuxiliaryType.Event: 0>
name
value
class _kratos.BreakStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.BuiltInFunctionStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
get_port(self: _kratos.FunctionStmtBlock, arg0: str) → _kratos.Port
has_attribute(self: _kratos.Stmt, arg0: str) → bool
input(self: _kratos.FunctionStmtBlock, arg0: str, arg1: int, arg2: bool) → _kratos.Port
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
return_stmt(self: _kratos.FunctionStmtBlock, arg0: _kratos.Var) → _kratos.ReturnStmt
return_width(self: _kratos.BuiltInFunctionStmtBlock) → int
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
set_port_ordering(*args, **kwargs)

Overloaded function.

  1. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[str, int]) -> None
  2. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[int, str]) -> None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.CombinationalStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
general_purpose
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.CommentStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.ConditionalExpr
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.Const
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
const_generator() → kratos::Generator
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_bignum
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
set_value(self: _kratos.Const, arg0: int) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
value(self: _kratos.Const) → int
verilog_ln
width
class _kratos.Context
add(self: _kratos.Context, internal_generator: kratos::Generator) → None
change_generator_name(self: _kratos.Context, internal_generator: kratos::Generator, new_name: str) → None
clear(self: _kratos.Context) → None
clear_hash(self: _kratos.Context) → None
empty_generator(self: _kratos.Context) → kratos::Generator
enum(self: _kratos.Context, enum_name: str, definition: Dict[str, int], width: int) → kratos::Enum
generator(self: _kratos.Context, arg0: str) → kratos::Generator
get_generators_by_name(self: _kratos.Context, name: str) → Set[kratos::Generator]
get_hash(self: _kratos.Context, internal_generator: kratos::Generator) → int
has_enum(self: _kratos.Context, arg0: str) → bool
has_hash(self: _kratos.Context, internal_generator: kratos::Generator) → bool
hash_table_size(self: _kratos.Context) → int
testbench(self: _kratos.Context, arg0: str) → kratos::TestBench
track_generated
class _kratos.DPIFunctionStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
get_port(self: _kratos.FunctionStmtBlock, arg0: str) → _kratos.Port
has_attribute(self: _kratos.Stmt, arg0: str) → bool
input(self: _kratos.DPIFunctionStmtBlock, arg0: str, arg1: int, arg2: bool) → _kratos.Port
is_context(self: _kratos.DPIFunctionStmtBlock) → bool
is_pure(self: _kratos.DPIFunctionStmtBlock) → bool
output(self: _kratos.DPIFunctionStmtBlock, arg0: str, arg1: int, arg2: bool) → _kratos.Port
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
return_stmt(self: _kratos.FunctionStmtBlock, arg0: _kratos.Var) → _kratos.ReturnStmt
scope_context
set_is_context(self: _kratos.DPIFunctionStmtBlock, arg0: bool) → None
set_is_pure(self: _kratos.DPIFunctionStmtBlock, arg0: bool) → None
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
set_port_ordering(*args, **kwargs)

Overloaded function.

  1. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[str, int]) -> None
  2. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[int, str]) -> None
set_return_width(self: _kratos.DPIFunctionStmtBlock, arg0: int) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.DebugDataBase
save_database(*args, **kwargs)

Overloaded function.

  1. save_database(self: _kratos.DebugDataBase, filename: str, override: bool) -> None
  2. save_database(self: _kratos.DebugDataBase, filename: str) -> None
set_break_points(self: _kratos.DebugDataBase, arg: _kratos.Generator) → None
set_variable_mapping(*args, **kwargs)

Overloaded function.

  1. set_variable_mapping(self: _kratos.DebugDataBase, mapping: Dict[_kratos.Generator, Dict[str, _kratos.Var]]) -> None
  2. set_variable_mapping(self: _kratos.DebugDataBase, mapping: Dict[_kratos.Generator, Dict[str, str]]) -> None
class _kratos.DelaySide

Members:

Left

Right

Left = <DelaySide.Left: 0>
Right = <DelaySide.Right: 1>
name
value
class _kratos.Enum
external
name
class _kratos.EnumConst
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
const_generator() → kratos::Generator
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_bignum
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
set_value(self: _kratos.Const, arg0: int) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
value(self: _kratos.Const) → int
verilog_ln
width
class _kratos.EnumPort
active_high
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
connected(self: _kratos.Port) → bool
connected_from(self: _kratos.Port) → Set[_kratos.Port]
connected_to(self: _kratos.Port) → Set[_kratos.Port]
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
port_direction
port_type
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.EnumVar
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
enum_type(self: _kratos.EnumVar) → kratos::Enum
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.Event
class _kratos.EventActionType

Members:

None_

Start

End

End = <EventActionType.End: 2>
None_ = <EventActionType.None_: 0>
Start = <EventActionType.Start: 1>
name
value
class _kratos.EventControl
delay
delay_side
edge
class _kratos.EventDelayStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
aux(self: _kratos.AuxiliaryStmt) → _kratos.AuxiliaryType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
event
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.EventEdgeType

Members:

Posedge

Negedge

Negedge = <EventEdgeType.Negedge: 1>
Posedge = <EventEdgeType.Posedge: 0>
name
value
class _kratos.EventInfo
combinational
fields
name
stmt
transaction
type
class _kratos.EventTracingStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
aux(self: _kratos.AuxiliaryStmt) → _kratos.AuxiliaryType
belongs(*args, **kwargs)

Overloaded function.

  1. belongs(self: _kratos.EventTracingStmt, arg0: str) -> _kratos.EventTracingStmt
  2. belongs(self: _kratos.EventTracingStmt, arg0: kratos::Transaction) -> _kratos.EventTracingStmt
  3. belongs(self: _kratos.EventTracingStmt, arg0: kratos::Transaction, arg1: str, arg2: int) -> _kratos.EventTracingStmt
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
match_values
matches(*args, **kwargs)

Overloaded function.

  1. matches(self: _kratos.EventTracingStmt, arg0: str, arg1: _kratos.Var) -> _kratos.EventTracingStmt
  2. matches(self: _kratos.EventTracingStmt, **kwargs) -> _kratos.EventTracingStmt
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
starts(*args, **kwargs)

Overloaded function.

  1. starts(self: _kratos.EventTracingStmt) -> _kratos.EventTracingStmt
  2. starts(self: _kratos.EventTracingStmt, arg0: str) -> _kratos.EventTracingStmt
terminates(*args, **kwargs)

Overloaded function.

  1. terminates(self: _kratos.EventTracingStmt) -> _kratos.EventTracingStmt
  2. terminates(self: _kratos.EventTracingStmt, arg0: str) -> _kratos.EventTracingStmt
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.Expr
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.FSM
add_child_fsm(self: _kratos.FSM, arg0: _kratos.FSM) → None
add_state(*args, **kwargs)

Overloaded function.

  1. add_state(self: _kratos.FSM, arg0: str) -> kratos::FSMState
  2. add_state(self: _kratos.FSM, arg0: str, arg1: Tuple[str, int]) -> kratos::FSMState
current_state
dot_graph(*args, **kwargs)

Overloaded function.

  1. dot_graph(self: _kratos.FSM) -> str
  2. dot_graph(self: _kratos.FSM, arg0: str) -> None
fsm_name(self: _kratos.FSM) → str
get_all_child_fsm(self: _kratos.FSM) → List[_kratos.FSM]
get_state(self: _kratos.FSM, arg0: str) → kratos::FSMState
is_moore(self: _kratos.FSM) → bool
output(*args, **kwargs)

Overloaded function.

  1. output(self: _kratos.FSM, arg0: str) -> None
  2. output(self: _kratos.FSM, arg0: _kratos.Var) -> None
  3. output(self: _kratos.FSM, arg0: _kratos.Var, arg1: _kratos.Var) -> None
  4. output(self: _kratos.FSM, arg0: str, arg1: _kratos.Var) -> None
output_table(*args, **kwargs)

Overloaded function.

  1. output_table(self: _kratos.FSM) -> str
  2. output_table(self: _kratos.FSM, arg0: str) -> None
outputs(self: _kratos.FSM) → Dict[_kratos.Var, _kratos.Var]
realize(self: _kratos.FSM) → None
set_moore(self: _kratos.FSM, arg0: bool) → None
set_reset_high(self: _kratos.FSM, arg0: bool) → None
set_start_state(*args, **kwargs)

Overloaded function.

  1. set_start_state(self: _kratos.FSM, arg0: str) -> None
  2. set_start_state(self: _kratos.FSM, arg0: kratos::FSMState) -> None
  3. set_start_state(self: _kratos.FSM, arg0: str, arg1: Tuple[str, int]) -> None
  4. set_start_state(self: _kratos.FSM, arg0: kratos::FSMState, arg1: Tuple[str, int]) -> None
class _kratos.FSMState
name
next(*args, **kwargs)

Overloaded function.

  1. next(self: _kratos.FSMState, arg0: _kratos.FSMState, arg1: _kratos.Var) -> None
  2. next(self: _kratos.FSMState, arg0: _kratos.FSMState, arg1: _kratos.Var, arg2: Tuple[str, int]) -> None
output(*args, **kwargs)

Overloaded function.

  1. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: _kratos.Var) -> None
  2. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: int) -> None
  3. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: _kratos.Var, arg2: Tuple[str, int]) -> None
  4. output(self: _kratos.FSMState, arg0: _kratos.Var, arg1: int, arg2: Tuple[str, int]) -> None
class _kratos.FinalStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.ForStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.ForStmt, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.ForStmt, arg0: _kratos.FunctionCallVar) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
get_iter_var(self: _kratos.ForStmt) → _kratos.IterVar
get_loop_body(self: _kratos.ForStmt) → _kratos.ScopedStmtBlock
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.FunctionCallVar
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.FunctionStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
get_port(self: _kratos.FunctionStmtBlock, arg0: str) → _kratos.Port
has_attribute(self: _kratos.Stmt, arg0: str) → bool
input(self: _kratos.FunctionStmtBlock, arg0: str, arg1: int, arg2: bool) → _kratos.Port
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
return_stmt(self: _kratos.FunctionStmtBlock, arg0: _kratos.Var) → _kratos.ReturnStmt
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
set_port_ordering(*args, **kwargs)

Overloaded function.

  1. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[str, int]) -> None
  2. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[int, str]) -> None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.Generator
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Generator, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Generator, arg0: str) -> None
add_bundle_port_def(*args, **kwargs)

Overloaded function.

  1. add_bundle_port_def(self: _kratos.Generator, arg0: str, arg1: kratos::PortBundleDefinition, arg2: Tuple[str, int]) -> kratos::PortBundleRef
  2. add_bundle_port_def(self: _kratos.Generator, arg0: str, arg1: kratos::PortBundleDefinition) -> kratos::PortBundleRef
add_child_generator(*args, **kwargs)

Overloaded function.

  1. add_child_generator(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator) -> None
  2. add_child_generator(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator, arg2: Tuple[str, int]) -> None
add_fn_ln(self: _kratos.Generator, arg0: Tuple[str, int]) → None
add_named_block(self: _kratos.Generator, arg0: str, arg1: kratos::StmtBlock) → None
add_raw_import(self: _kratos.Generator, arg0: str) → None
add_stmt(self: _kratos.Generator, arg0: kratos::Stmt) → None
attributes
builtin_function(self: _kratos.Generator, arg0: str) → kratos::BuiltInFunctionStmtBlock
call(*args, **kwargs)

Overloaded function.

  1. call(self: _kratos.Generator, arg0: str, arg1: Dict[str, _kratos.Var]) -> _kratos.FunctionCallVar
  2. call(self: _kratos.Generator, arg0: str, arg1: Dict[str, _kratos.Var], arg2: bool) -> _kratos.FunctionCallVar
  3. call(self: _kratos.Generator, arg0: str, arg1: List[_kratos.Var]) -> _kratos.FunctionCallVar
clone(self: _kratos.Generator) → _kratos.Generator
combinational(self: _kratos.Generator) → kratos::CombinationalStmtBlock
context(self: _kratos.Generator) → _kratos.Context
copy_over_missing_ports(self: _kratos.Generator, arg0: _kratos.Generator) → None
correct_wire_direction(*args, **kwargs)

Overloaded function.

  1. correct_wire_direction(self: _kratos.Generator, arg0: _kratos.Var, arg1: _kratos.Var) -> Tuple[bool, bool]
  2. correct_wire_direction(self: _kratos.Generator, arg0: _kratos.Var, arg1: int) -> Tuple[bool, bool]
  3. correct_wire_direction(self: _kratos.Generator, arg0: int, arg1: _kratos.Var) -> Tuple[bool, bool]
debug
def_instance
dpi_function(self: _kratos.Generator, arg0: str) → kratos::DPIFunctionStmtBlock
enum(self: _kratos.Generator, arg0: str, arg1: Dict[str, int], arg2: int) → kratos::Enum
enum_var(self: _kratos.Generator, arg0: str, arg1: kratos::Enum) → _kratos.EnumVar
external(self: _kratos.Generator) → bool
external_filename(self: _kratos.Generator) → str
final(self: _kratos.Generator) → kratos::FinalStmtBlock
find_attribute(self: _kratos.passes.IRNode, arg0: Callable[[kratos::Attribute], bool]) → List[kratos::Attribute]
from_verilog(self: _kratos.Context, arg0: str, arg1: str, arg2: List[str], arg3: Dict[str, _kratos.PortType]) → _kratos.Generator
fsm(*args, **kwargs)

Overloaded function.

  1. fsm(self: _kratos.Generator, arg0: str) -> kratos::FSM
  2. fsm(self: _kratos.Generator, arg0: str, arg1: _kratos.Var, arg2: _kratos.Var) -> kratos::FSM
function(self: _kratos.Generator, arg0: str) → kratos::FunctionStmtBlock
get_attributes(self: _kratos.passes.IRNode) → List[kratos::Attribute]
get_bundle_ref(self: _kratos.Generator, arg0: str) → kratos::PortBundleRef
get_child_generator_size(self: _kratos.Generator) → int
get_child_generators(self: _kratos.Generator) → List[_kratos.Generator]
get_function(self: _kratos.Generator, arg0: str) → kratos::FunctionStmtBlock
get_interface(self: _kratos.Generator, arg0: str) → kratos::InterfaceRef
get_named_block(self: _kratos.Generator, arg0: str) → kratos::StmtBlock
get_param(self: _kratos.Generator, arg0: str) → _kratos.Param
get_params(self: _kratos.Generator) → Dict[str, _kratos.Param]
get_port(self: _kratos.Generator, arg0: str) → _kratos.Port
get_port_names(self: _kratos.Generator) → Set[str]
get_ports(self: _kratos.Generator, arg0: _kratos.PortType) → List[str]
get_stmt(self: _kratos.Generator, arg0: int) → kratos::Stmt
get_unique_variable_name(self: _kratos.Generator, arg0: str, arg1: str) → str
get_var(self: _kratos.Generator, arg0: str) → _kratos.Var
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Generator) -> str
  2. handle_name(self: _kratos.Generator, arg0: bool) -> str
has_attribute(self: _kratos.passes.IRNode, arg0: str) → bool
has_child_generator(*args, **kwargs)

Overloaded function.

  1. has_child_generator(self: _kratos.Generator, arg0: _kratos.Generator) -> bool
  2. has_child_generator(self: _kratos.Generator, arg0: str) -> bool
has_function(self: _kratos.Generator, arg0: str) → bool
has_interface(self: _kratos.Generator, arg0: str) → bool
has_named_block(self: _kratos.Generator, arg0: str) → bool
has_port(self: _kratos.Generator, arg0: str) → bool
has_port_bundle(self: _kratos.Generator, arg0: str) → bool
has_var(self: _kratos.Generator, arg0: str) → bool
initial(self: _kratos.Generator) → kratos::InitialStmtBlock
instance_name
interface(*args, **kwargs)

Overloaded function.

  1. interface(self: _kratos.Generator, arg0: kratos::InterfaceDefinition, arg1: str, arg2: bool) -> kratos::InterfaceRef
  2. interface(self: _kratos.Generator, arg0: kratos::InterfaceModPortDefinition, arg1: str, arg2: bool) -> kratos::InterfaceRef
is_cloned
is_stub(self: _kratos.Generator) → bool
latch(self: _kratos.Generator) → kratos::LatchStmtBlock
name
param_iter(self: _kratos.Generator) → Iterator
parameter(*args, **kwargs)

Overloaded function.

  1. parameter(self: _kratos.Generator, arg0: str) -> _kratos.Param
  2. parameter(self: _kratos.Generator, arg0: str, arg1: int, arg2: bool) -> _kratos.Param
  3. parameter(self: _kratos.Generator, arg0: _kratos.Param, arg1: Optional[str]) -> _kratos.Param
  4. parameter(self: _kratos.Generator, arg0: str, arg1: kratos::Enum) -> _kratos.Param
parent_generator(self: _kratos.Generator) → _kratos.Generator
port(*args, **kwargs)

Overloaded function.

  1. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: int) -> _kratos.Port
  2. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: int, arg3: int, arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  3. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: int, arg3: List[int], arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  4. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.Var, arg3: int, arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  5. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.Var, arg3: List[int], arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  6. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: kratos::Enum) -> _kratos.EnumPort
  7. port(self: _kratos.Generator, arg0: _kratos.EnumPort, arg1: bool) -> _kratos.Port
  8. port(self: _kratos.Generator, arg0: _kratos.EnumPort, arg1: str, arg2: bool) -> _kratos.Port
  9. port(self: _kratos.Generator, arg0: _kratos.Port) -> _kratos.Port
  10. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: str) -> _kratos.Port
  11. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: str, arg2: bool) -> _kratos.Port
  12. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: bool) -> _kratos.Port
  13. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: str, arg2: bool) -> _kratos.Port
  14. port(self: _kratos.Generator, arg0: _kratos.PortPackedStruct, arg1: bool) -> _kratos.Port
  15. port(self: _kratos.Generator, arg0: _kratos.PortPackedStruct, arg1: str, arg2: bool) -> _kratos.Port
port_packed(*args, **kwargs)

Overloaded function.

  1. port_packed(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.PackedStruct) -> _kratos.PortPackedStruct
  2. port_packed(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.PackedStruct, arg3: int) -> _kratos.PortPackedStruct
  3. port_packed(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.PackedStruct, arg3: List[int]) -> _kratos.PortPackedStruct
ports_iter(self: _kratos.Generator) → Iterator
property(self: _kratos.Generator, arg0: str, arg1: kratos::Sequence) → kratos::Property
raw_package_imports
remove_child_generator(self: _kratos.Generator, arg0: _kratos.Generator) → None
remove_port(self: _kratos.Generator, arg0: str) → None
remove_stmt(self: _kratos.Generator, arg0: kratos::Stmt) → None
remove_var(self: _kratos.Generator, arg0: str) → None
replace(*args, **kwargs)

Overloaded function.

  1. replace(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator) -> None
  2. replace(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator, arg2: Tuple[str, int]) -> None
sequential(self: _kratos.Generator) → kratos::SequentialStmtBlock
set_child_comment(self: _kratos.Generator, arg0: str, arg1: str) → None
set_clone_ref(self: _kratos.Generator, arg0: _kratos.Generator) → None
set_external(self: _kratos.Generator, arg0: bool) → None
set_is_stub(self: _kratos.Generator, arg0: bool) → None
stmts_count(self: _kratos.Generator) → int
task(self: _kratos.Generator, arg0: str) → kratos::TaskStmtBlock
unwire(self: _kratos.Generator, arg0: _kratos.Var, arg1: _kratos.Var) → None
var(*args, **kwargs)

Overloaded function.

  1. var(self: _kratos.Generator, arg0: str, arg1: int) -> _kratos.Var
  2. var(self: _kratos.Generator, arg0: str, arg1: int, arg2: int, arg3: bool) -> _kratos.Var
  3. var(self: _kratos.Generator, arg0: str, arg1: int, arg2: List[int]) -> _kratos.Var
  4. var(self: _kratos.Generator, arg0: str, arg1: int, arg2: List[int], arg3: bool) -> _kratos.Var
  5. var(self: _kratos.Generator, arg0: str, arg1: _kratos.Var, arg2: int, arg3: bool) -> _kratos.Var
  6. var(self: _kratos.Generator, arg0: str, arg1: _kratos.Var, arg2: List[int], arg3: bool) -> _kratos.Var
  7. var(self: _kratos.Generator, arg0: _kratos.Var, arg1: str) -> _kratos.Var
var_packed(*args, **kwargs)

Overloaded function.

  1. var_packed(self: _kratos.Generator, arg0: str, arg1: _kratos.PackedStruct) -> _kratos.VarPackedStruct
  2. var_packed(self: _kratos.Generator, arg0: str, arg1: _kratos.PackedStruct, arg2: int) -> _kratos.VarPackedStruct
  3. var_packed(self: _kratos.Generator, arg0: str, arg1: _kratos.PackedStruct, arg2: List[int]) -> _kratos.VarPackedStruct
vars(self: _kratos.Generator) → Dict[str, _kratos.Var]
vars_iter(self: _kratos.Generator) → Iterator
verilog_fn
verilog_ln
wire(self: _kratos.Generator, arg0: _kratos.Var, arg1: _kratos.Var) → None
wire_interface(self: _kratos.Generator, arg0: kratos::InterfaceRef, arg1: kratos::InterfaceRef) → None
wire_ports(self: _kratos.Generator, arg0: _kratos.Port, arg1: _kratos.Port) → kratos::Stmt
class _kratos.HashStrategy

Members:

SequentialHash

ParallelHash

ParallelHash = <HashStrategy.ParallelHash: 1>
SequentialHash = <HashStrategy.SequentialHash: 0>
name
value
class _kratos.IRNodeKind

Members:

GeneratorKind

VarKind

StmtKind

GeneratorKind = <IRNodeKind.GeneratorKind: 0>
StmtKind = <IRNodeKind.StmtKind: 2>
VarKind = <IRNodeKind.VarKind: 1>
name
value
class _kratos.IfStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_else_stmt(self: _kratos.IfStmt, arg0: _kratos.Stmt) → None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_then_stmt(self: _kratos.IfStmt, arg0: _kratos.Stmt) → None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
else_
else_body(self: _kratos.IfStmt) → kratos::ScopedStmtBlock
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
predicate(self: _kratos.IfStmt) → _kratos.Var
remove_else_stmt(self: _kratos.IfStmt, arg0: _kratos.Stmt) → None
remove_then_stmt(self: _kratos.IfStmt, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
then_
then_body(self: _kratos.IfStmt) → kratos::ScopedStmtBlock
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.InitialStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.Interface
clock(self: _kratos.Interface, arg0: str) → str
has_port(self: _kratos.Interface, arg0: str) → bool
has_var(self: _kratos.Interface, arg0: str) → bool
input(self: _kratos.Interface, arg0: str, arg1: int, arg2: int) → str
modport(self: _kratos.Interface, arg0: str) → kratos::InterfaceModPortDefinition
output(self: _kratos.Interface, arg0: str, arg1: int, arg2: int) → str
port(*args, **kwargs)

Overloaded function.

  1. port(self: _kratos.Interface, arg0: str, arg1: int, arg2: int, arg3: _kratos.PortDirection) -> str
  2. port(self: _kratos.Interface, arg0: str, arg1: int, arg2: List[int], arg3: _kratos.PortDirection) -> str
  3. port(self: _kratos.Interface, arg0: str, arg1: int, arg2: List[int], arg3: _kratos.PortDirection, arg4: _kratos.PortType) -> str
reset(self: _kratos.Interface, arg0: str) → str
var(*args, **kwargs)

Overloaded function.

  1. var(self: _kratos.Interface, arg0: str, arg1: int, arg2: int) -> str
  2. var(self: _kratos.Interface, arg0: str, arg1: int, arg2: List[int]) -> str
  3. var(self: _kratos.Interface, arg0: str, arg1: int) -> str
class _kratos.InterfaceRef
get_modport_ref(self: _kratos.InterfaceRef, arg0: str) → _kratos.InterfaceRef
has_modport(self: _kratos.InterfaceRef, arg0: str) → bool
has_port(self: _kratos.InterfaceRef, arg0: str) → bool
has_var(self: _kratos.InterfaceRef, arg0: str) → bool
port(self: _kratos.InterfaceRef, arg0: str) → _kratos.Port
var(self: _kratos.InterfaceRef, arg0: str) → _kratos.Var
class _kratos.IterVar
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.LatchStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.ModPortInterface
set_input(self: _kratos.ModPortInterface, arg0: str) → None
set_output(self: _kratos.ModPortInterface, arg0: str) → None
class _kratos.ModuleInstantiationStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.PackedSlice
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.PackedStruct
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.PackedStruct, arg0: str, arg1: int) -> None
  2. add_attribute(self: _kratos.PackedStruct, arg0: str, arg1: int, arg2: bool) -> None
  3. add_attribute(self: _kratos.PackedStruct, arg0: str, arg1: _kratos.PackedStruct) -> None
attributes
external
struct_name
class _kratos.Param
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
const_generator() → kratos::Generator
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
initial_raw_str_value
initial_value
is_bignum
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
param_type
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
set_value(self: _kratos.Const, arg0: int) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
value
verilog_ln
width
class _kratos.ParamType

Members:

RawType

Parameter

Enum

Integral

Enum = <ParamType.Enum: 2>
Integral = <ParamType.Integral: 0>
Parameter = <ParamType.Parameter: 1>
RawType = <ParamType.RawType: 3>
name
value
class _kratos.Port
active_high
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
connected(self: _kratos.Port) → bool
connected_from(self: _kratos.Port) → Set[_kratos.Port]
connected_to(self: _kratos.Port) → Set[_kratos.Port]
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
port_direction
port_type
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.PortBundleDefinition
add_debug_info(self: _kratos.PortBundleDefinition, arg0: str, arg1: Tuple[str, int]) → None
add_definition(self: _kratos.PortBundleDefinition, arg0: str, arg1: int, arg2: int, arg3: bool, arg4: _kratos.PortDirection, arg5: _kratos.PortType) → None
definition(self: _kratos.PortBundleDefinition) → Dict[str, Tuple[int, int, bool, _kratos.PortDirection, _kratos.PortType]]
flip(self: _kratos.PortBundleDefinition) → _kratos.PortBundleDefinition
name
class _kratos.PortBundleRef
assign(self: _kratos.PortBundleRef, arg0: _kratos.PortBundleRef, arg1: _kratos.Generator, arg2: List[Tuple[str, int]]) → None
member_names(self: _kratos.PortBundleRef) → Set[str]
class _kratos.PortDirection

Members:

In

Out

InOut

In = <PortDirection.In: 0>
InOut = <PortDirection.InOut: 2>
Out = <PortDirection.Out: 1>
name
value
class _kratos.PortPackedStruct
active_high
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
connected(self: _kratos.Port) → bool
connected_from(self: _kratos.Port) → Set[_kratos.Port]
connected_to(self: _kratos.Port) → Set[_kratos.Port]
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
member_names(self: _kratos.PortPackedStruct) → Set[str]
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
port_direction
port_type
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.PortType

Members:

Clock

AsyncReset

ClockEnable

Data

Reset

AsyncReset = <PortType.AsyncReset: 2>
Clock = <PortType.Clock: 1>
ClockEnable = <PortType.ClockEnable: 4>
Data = <PortType.Data: 0>
Reset = <PortType.Reset: 3>
name
value
class _kratos.Property
action
edge(*args, **kwargs)

Overloaded function.

  1. edge(self: _kratos.Property, arg0: _kratos.EventEdgeType, arg1: _kratos.Var) -> None
  2. edge(self: _kratos.Property) -> _kratos.EventControl
property_name(self: _kratos.Property) → str
sequence(self: _kratos.Property) → _kratos.Sequence
class _kratos.PropertyAction

Members:

None

Cover

Assume

Assert

Assert = <PropertyAction.Assert: 8>
Assume = <PropertyAction.Assume: 4>
Cover = <PropertyAction.Cover: 2>
None = <PropertyAction.None: 0>
name
value
class _kratos.RawStringStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.ReturnStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.ScopedStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.Sequence
imply(self: _kratos.Sequence, arg0: _kratos.Var) → _kratos.Sequence
next(self: _kratos.Sequence) → _kratos.Sequence
wait(*args, **kwargs)

Overloaded function.

  1. wait(self: _kratos.Sequence, arg0: int) -> _kratos.Sequence
  2. wait(self: _kratos.Sequence, arg0: int, arg1: int) -> _kratos.Sequence
class _kratos.SequentialStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_condition(self: _kratos.SequentialStmtBlock, arg0: Tuple[_kratos.EventEdgeType, _kratos.Var]) → None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
get_event_controls(self: _kratos.SequentialStmtBlock) → List[kratos::EventControl]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.Simulator
get(self: _kratos.Simulator, arg0: _kratos.Var) → Optional[int]
get_array(self: _kratos.Simulator, arg0: _kratos.Var) → Optional[List[int]]
set(*args, **kwargs)

Overloaded function.

  1. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[int], arg2: bool) -> None
  2. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[List[int]], arg2: bool) -> None
  3. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[int], arg2: bool) -> None
  4. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[List[int]], arg2: bool) -> None
  5. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[int]) -> None
  6. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[List[int]]) -> None
  7. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[int]) -> None
  8. set(self: _kratos.Simulator, arg0: _kratos.Var, arg1: Optional[List[int]]) -> None
class _kratos.StatementBlockType

Members:

Combinational

Sequential

Initial

Latch

Final

Combinational = <StatementBlockType.Combinational: 0>
Final = <StatementBlockType.Final: 6>
Initial = <StatementBlockType.Initial: 4>
Latch = <StatementBlockType.Latch: 5>
Sequential = <StatementBlockType.Sequential: 1>
name
value
class _kratos.StatementType

Members:

If

Switch

Assign

Block

ModuleInstantiation

Assign = <StatementType.Assign: 3>
Block = <StatementType.Block: 4>
If = <StatementType.If: 0>
ModuleInstantiation = <StatementType.ModuleInstantiation: 5>
Switch = <StatementType.Switch: 1>
name
value
class _kratos.Stmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
attributes
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.StmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.SwitchStmt
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_switch_case(*args, **kwargs)

Overloaded function.

  1. add_switch_case(self: _kratos.SwitchStmt, arg0: _kratos.Const, arg1: _kratos.Stmt) -> kratos::ScopedStmtBlock
  2. add_switch_case(self: _kratos.SwitchStmt, arg0: _kratos.Const, arg1: List[_kratos.Stmt]) -> kratos::ScopedStmtBlock
attributes
body(self: _kratos.SwitchStmt) → Dict[_kratos.Const, kratos::ScopedStmtBlock]
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
has_attribute(self: _kratos.Stmt, arg0: str) → bool
remove_switch_case(*args, **kwargs)

Overloaded function.

  1. remove_switch_case(self: _kratos.SwitchStmt, arg0: _kratos.Const) -> None
  2. remove_switch_case(self: _kratos.SwitchStmt, arg0: _kratos.Const, arg1: _kratos.Stmt) -> None
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
target(self: _kratos.SwitchStmt) → _kratos.Var
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.SystemVerilogCodeGenOptions
extract_debug_info
line_wrap
output_dir
package_name
unique_case
class _kratos.TaskStmtBlock
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Stmt, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Stmt, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Stmt, arg0: Tuple[str, int], arg1: bool) -> None
add_scope_variable(*args, **kwargs)

Overloaded function.

  1. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool, arg3: bool) -> None
  2. add_scope_variable(self: _kratos.Stmt, arg0: str, arg1: str, arg2: bool) -> None
add_stmt(*args, **kwargs)

Overloaded function.

  1. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) -> None
  2. add_stmt(self: _kratos.StmtBlock, arg0: _kratos.FunctionCallVar) -> None
attributes
block_type(self: _kratos.StmtBlock) → _kratos.StatementBlockType
clone(self: _kratos.Stmt) → _kratos.Stmt
comment
find_attribute(self: _kratos.Stmt, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
get_attributes(self: _kratos.Stmt) → List[_kratos.passes.Attribute]
get_port(self: _kratos.FunctionStmtBlock, arg0: str) → _kratos.Port
has_attribute(self: _kratos.Stmt, arg0: str) → bool
input(self: _kratos.FunctionStmtBlock, arg0: str, arg1: int, arg2: bool) → _kratos.Port
remove_stmt(self: _kratos.StmtBlock, arg0: _kratos.Stmt) → None
return_stmt(self: _kratos.FunctionStmtBlock, arg0: _kratos.Var) → _kratos.ReturnStmt
scope_context
set_parent(self: _kratos.Stmt, arg0: _kratos.passes.IRNode) → None
set_port_ordering(*args, **kwargs)

Overloaded function.

  1. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[str, int]) -> None
  2. set_port_ordering(self: _kratos.FunctionStmtBlock, arg0: Dict[int, str]) -> None
type(self: _kratos.Stmt) → _kratos.StatementType
verilog_ln
class _kratos.TestBench
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Generator, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Generator, arg0: str) -> None
add_bundle_port_def(*args, **kwargs)

Overloaded function.

  1. add_bundle_port_def(self: _kratos.Generator, arg0: str, arg1: kratos::PortBundleDefinition, arg2: Tuple[str, int]) -> kratos::PortBundleRef
  2. add_bundle_port_def(self: _kratos.Generator, arg0: str, arg1: kratos::PortBundleDefinition) -> kratos::PortBundleRef
add_child_generator(*args, **kwargs)

Overloaded function.

  1. add_child_generator(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator) -> None
  2. add_child_generator(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator, arg2: Tuple[str, int]) -> None
add_fn_ln(self: _kratos.Generator, arg0: Tuple[str, int]) → None
add_named_block(self: _kratos.Generator, arg0: str, arg1: kratos::StmtBlock) → None
add_raw_import(self: _kratos.Generator, arg0: str) → None
add_stmt(self: _kratos.Generator, arg0: kratos::Stmt) → None
attributes
builtin_function(self: _kratos.Generator, arg0: str) → kratos::BuiltInFunctionStmtBlock
call(*args, **kwargs)

Overloaded function.

  1. call(self: _kratos.Generator, arg0: str, arg1: Dict[str, _kratos.Var]) -> _kratos.FunctionCallVar
  2. call(self: _kratos.Generator, arg0: str, arg1: Dict[str, _kratos.Var], arg2: bool) -> _kratos.FunctionCallVar
  3. call(self: _kratos.Generator, arg0: str, arg1: List[_kratos.Var]) -> _kratos.FunctionCallVar
clone(self: _kratos.Generator) → _kratos.Generator
combinational(self: _kratos.Generator) → kratos::CombinationalStmtBlock
context(self: _kratos.Generator) → _kratos.Context
copy_over_missing_ports(self: _kratos.Generator, arg0: _kratos.Generator) → None
correct_wire_direction(*args, **kwargs)

Overloaded function.

  1. correct_wire_direction(self: _kratos.Generator, arg0: _kratos.Var, arg1: _kratos.Var) -> Tuple[bool, bool]
  2. correct_wire_direction(self: _kratos.Generator, arg0: _kratos.Var, arg1: int) -> Tuple[bool, bool]
  3. correct_wire_direction(self: _kratos.Generator, arg0: int, arg1: _kratos.Var) -> Tuple[bool, bool]
debug
def_instance
dpi_function(self: _kratos.Generator, arg0: str) → kratos::DPIFunctionStmtBlock
enum(self: _kratos.Generator, arg0: str, arg1: Dict[str, int], arg2: int) → kratos::Enum
enum_var(self: _kratos.Generator, arg0: str, arg1: kratos::Enum) → _kratos.EnumVar
external(self: _kratos.Generator) → bool
external_filename(self: _kratos.Generator) → str
final(self: _kratos.Generator) → kratos::FinalStmtBlock
find_attribute(self: _kratos.passes.IRNode, arg0: Callable[[kratos::Attribute], bool]) → List[kratos::Attribute]
from_verilog(self: _kratos.Context, arg0: str, arg1: str, arg2: List[str], arg3: Dict[str, _kratos.PortType]) → _kratos.Generator
fsm(*args, **kwargs)

Overloaded function.

  1. fsm(self: _kratos.Generator, arg0: str) -> kratos::FSM
  2. fsm(self: _kratos.Generator, arg0: str, arg1: _kratos.Var, arg2: _kratos.Var) -> kratos::FSM
function(self: _kratos.Generator, arg0: str) → kratos::FunctionStmtBlock
get_attributes(self: _kratos.passes.IRNode) → List[kratos::Attribute]
get_bundle_ref(self: _kratos.Generator, arg0: str) → kratos::PortBundleRef
get_child_generator_size(self: _kratos.Generator) → int
get_child_generators(self: _kratos.Generator) → List[_kratos.Generator]
get_function(self: _kratos.Generator, arg0: str) → kratos::FunctionStmtBlock
get_interface(self: _kratos.Generator, arg0: str) → kratos::InterfaceRef
get_named_block(self: _kratos.Generator, arg0: str) → kratos::StmtBlock
get_param(self: _kratos.Generator, arg0: str) → _kratos.Param
get_params(self: _kratos.Generator) → Dict[str, _kratos.Param]
get_port(self: _kratos.Generator, arg0: str) → _kratos.Port
get_port_names(self: _kratos.Generator) → Set[str]
get_ports(self: _kratos.Generator, arg0: _kratos.PortType) → List[str]
get_stmt(self: _kratos.Generator, arg0: int) → kratos::Stmt
get_unique_variable_name(self: _kratos.Generator, arg0: str, arg1: str) → str
get_var(self: _kratos.Generator, arg0: str) → _kratos.Var
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Generator) -> str
  2. handle_name(self: _kratos.Generator, arg0: bool) -> str
has_attribute(self: _kratos.passes.IRNode, arg0: str) → bool
has_child_generator(*args, **kwargs)

Overloaded function.

  1. has_child_generator(self: _kratos.Generator, arg0: _kratos.Generator) -> bool
  2. has_child_generator(self: _kratos.Generator, arg0: str) -> bool
has_function(self: _kratos.Generator, arg0: str) → bool
has_interface(self: _kratos.Generator, arg0: str) → bool
has_named_block(self: _kratos.Generator, arg0: str) → bool
has_port(self: _kratos.Generator, arg0: str) → bool
has_port_bundle(self: _kratos.Generator, arg0: str) → bool
has_var(self: _kratos.Generator, arg0: str) → bool
initial(self: _kratos.Generator) → kratos::InitialStmtBlock
instance_name
interface(*args, **kwargs)

Overloaded function.

  1. interface(self: _kratos.Generator, arg0: kratos::InterfaceDefinition, arg1: str, arg2: bool) -> kratos::InterfaceRef
  2. interface(self: _kratos.Generator, arg0: kratos::InterfaceModPortDefinition, arg1: str, arg2: bool) -> kratos::InterfaceRef
is_cloned
is_stub(self: _kratos.Generator) → bool
latch(self: _kratos.Generator) → kratos::LatchStmtBlock
name
param_iter(self: _kratos.Generator) → Iterator
parameter(*args, **kwargs)

Overloaded function.

  1. parameter(self: _kratos.Generator, arg0: str) -> _kratos.Param
  2. parameter(self: _kratos.Generator, arg0: str, arg1: int, arg2: bool) -> _kratos.Param
  3. parameter(self: _kratos.Generator, arg0: _kratos.Param, arg1: Optional[str]) -> _kratos.Param
  4. parameter(self: _kratos.Generator, arg0: str, arg1: kratos::Enum) -> _kratos.Param
parent_generator(self: _kratos.Generator) → _kratos.Generator
port(*args, **kwargs)

Overloaded function.

  1. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: int) -> _kratos.Port
  2. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: int, arg3: int, arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  3. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: int, arg3: List[int], arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  4. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.Var, arg3: int, arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  5. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.Var, arg3: List[int], arg4: _kratos.PortType, arg5: bool) -> _kratos.Port
  6. port(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: kratos::Enum) -> _kratos.EnumPort
  7. port(self: _kratos.Generator, arg0: _kratos.EnumPort, arg1: bool) -> _kratos.Port
  8. port(self: _kratos.Generator, arg0: _kratos.EnumPort, arg1: str, arg2: bool) -> _kratos.Port
  9. port(self: _kratos.Generator, arg0: _kratos.Port) -> _kratos.Port
  10. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: str) -> _kratos.Port
  11. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: str, arg2: bool) -> _kratos.Port
  12. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: bool) -> _kratos.Port
  13. port(self: _kratos.Generator, arg0: _kratos.Port, arg1: str, arg2: bool) -> _kratos.Port
  14. port(self: _kratos.Generator, arg0: _kratos.PortPackedStruct, arg1: bool) -> _kratos.Port
  15. port(self: _kratos.Generator, arg0: _kratos.PortPackedStruct, arg1: str, arg2: bool) -> _kratos.Port
port_packed(*args, **kwargs)

Overloaded function.

  1. port_packed(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.PackedStruct) -> _kratos.PortPackedStruct
  2. port_packed(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.PackedStruct, arg3: int) -> _kratos.PortPackedStruct
  3. port_packed(self: _kratos.Generator, arg0: _kratos.PortDirection, arg1: str, arg2: _kratos.PackedStruct, arg3: List[int]) -> _kratos.PortPackedStruct
ports_iter(self: _kratos.Generator) → Iterator
property(self: _kratos.Generator, arg0: str, arg1: kratos::Sequence) → kratos::Property
raw_package_imports
remove_child_generator(self: _kratos.Generator, arg0: _kratos.Generator) → None
remove_port(self: _kratos.Generator, arg0: str) → None
remove_stmt(self: _kratos.Generator, arg0: kratos::Stmt) → None
remove_var(self: _kratos.Generator, arg0: str) → None
replace(*args, **kwargs)

Overloaded function.

  1. replace(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator) -> None
  2. replace(self: _kratos.Generator, arg0: str, arg1: _kratos.Generator, arg2: Tuple[str, int]) -> None
sequential(self: _kratos.Generator) → kratos::SequentialStmtBlock
set_child_comment(self: _kratos.Generator, arg0: str, arg1: str) → None
set_clone_ref(self: _kratos.Generator, arg0: _kratos.Generator) → None
set_external(self: _kratos.Generator, arg0: bool) → None
set_is_stub(self: _kratos.Generator, arg0: bool) → None
stmts_count(self: _kratos.Generator) → int
task(self: _kratos.Generator, arg0: str) → kratos::TaskStmtBlock
unwire(self: _kratos.Generator, arg0: _kratos.Var, arg1: _kratos.Var) → None
var(*args, **kwargs)

Overloaded function.

  1. var(self: _kratos.Generator, arg0: str, arg1: int) -> _kratos.Var
  2. var(self: _kratos.Generator, arg0: str, arg1: int, arg2: int, arg3: bool) -> _kratos.Var
  3. var(self: _kratos.Generator, arg0: str, arg1: int, arg2: List[int]) -> _kratos.Var
  4. var(self: _kratos.Generator, arg0: str, arg1: int, arg2: List[int], arg3: bool) -> _kratos.Var
  5. var(self: _kratos.Generator, arg0: str, arg1: _kratos.Var, arg2: int, arg3: bool) -> _kratos.Var
  6. var(self: _kratos.Generator, arg0: str, arg1: _kratos.Var, arg2: List[int], arg3: bool) -> _kratos.Var
  7. var(self: _kratos.Generator, arg0: _kratos.Var, arg1: str) -> _kratos.Var
var_packed(*args, **kwargs)

Overloaded function.

  1. var_packed(self: _kratos.Generator, arg0: str, arg1: _kratos.PackedStruct) -> _kratos.VarPackedStruct
  2. var_packed(self: _kratos.Generator, arg0: str, arg1: _kratos.PackedStruct, arg2: int) -> _kratos.VarPackedStruct
  3. var_packed(self: _kratos.Generator, arg0: str, arg1: _kratos.PackedStruct, arg2: List[int]) -> _kratos.VarPackedStruct
vars(self: _kratos.Generator) → Dict[str, _kratos.Var]
vars_iter(self: _kratos.Generator) → Iterator
verilog_fn
verilog_ln
wire(self: _kratos.Generator, arg0: _kratos.Var, arg1: _kratos.Var) → None
wire_interface(self: _kratos.Generator, arg0: kratos::InterfaceRef, arg1: kratos::InterfaceRef) → None
wire_ports(self: _kratos.Generator, arg0: _kratos.Port, arg1: _kratos.Port) → kratos::Stmt
class _kratos.Transaction
class _kratos.Var
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VarCastType

Members:

Signed

Unsigned

AsyncReset

ClockEnable

Clock

Enum

Resize

AsyncReset = <VarCastType.AsyncReset: 3>
Clock = <VarCastType.Clock: 2>
ClockEnable = <VarCastType.ClockEnable: 4>
Enum = <VarCastType.Enum: 6>
Resize = <VarCastType.Resize: 7>
Signed = <VarCastType.Signed: 0>
Unsigned = <VarCastType.Unsigned: 1>
name
value
class _kratos.VarCasted
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
enum_type
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
target_width
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VarConcat
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VarExtend
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VarPackedStruct
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
is_packed
member_names(self: _kratos.VarPackedStruct) → Set[str]
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VarSlice
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
high
is_packed
low
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
parent_var
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
sliced_by_var
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VarVarSlice
add_attribute(*args, **kwargs)

Overloaded function.

  1. add_attribute(self: _kratos.Var, arg0: _kratos.passes.Attribute) -> None
  2. add_attribute(self: _kratos.Var, arg0: str) -> None
add_fn_ln(*args, **kwargs)

Overloaded function.

  1. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int]) -> None
  2. add_fn_ln(self: _kratos.Var, arg0: Tuple[str, int], arg1: bool) -> None
and_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
ashr(*args, **kwargs)

Overloaded function.

  1. ashr(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. ashr(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. ashr(self: int, arg0: _kratos.Var) -> kratos::Expr
assign(*args, **kwargs)

Overloaded function.

  1. assign(self: _kratos.Var, arg0: _kratos.Var) -> kratos::AssignStmt
  2. assign(self: _kratos.Var, rhs: int) -> kratos::AssignStmt
  3. assign(self: _kratos.Var, rhs: _kratos.Var) -> kratos::AssignStmt
attributes
cast(self: _kratos.Var, arg0: _kratos.VarCastType) → _kratos.Var
comment
concat(self: _kratos.Var, var: _kratos.Var) → kratos::VarConcat
duplicate(*args, **kwargs)

Overloaded function.

  1. duplicate(self: _kratos.Var, count: int) -> kratos::Expr
  2. duplicate(self: _kratos.Var, count: kratos::Const) -> kratos::Expr
eq(*args, **kwargs)

Overloaded function.

  1. eq(self: _kratos.Var, arg0: _kratos.Var) -> kratos::Expr
  2. eq(self: _kratos.Var, arg0: int) -> kratos::Expr
  3. eq(self: int, arg0: _kratos.Var) -> kratos::Expr
explicit_array
extend(self: _kratos.Var, width: int) → kratos::VarExtend
find_attribute(self: _kratos.Var, arg0: Callable[[_kratos.passes.Attribute], bool]) → List[_kratos.passes.Attribute]
fn_name_ln
generator
get_attributes(self: _kratos.Var) → List[_kratos.passes.Attribute]
handle_name(*args, **kwargs)

Overloaded function.

  1. handle_name(self: _kratos.Var) -> str
  2. handle_name(self: _kratos.Var, arg0: bool) -> str
  3. handle_name(self: _kratos.Var, arg0: kratos::Generator) -> str
has_attribute(self: _kratos.Var, arg0: str) → bool
high
is_packed
low
static move_sink_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
static move_src_to(arg0: _kratos.Var, arg1: _kratos.Var, arg2: kratos::Generator, arg3: bool) → None
name
or_(self: _kratos.Var, arg0: _kratos.Var) → kratos::Expr
parent_var
r_and(self: _kratos.Var) → kratos::Expr
r_not(self: _kratos.Var) → kratos::Expr
r_or(self: _kratos.Var) → kratos::Expr
r_xor(self: _kratos.Var) → kratos::Expr
raw_type_param
rename(self: _kratos.Var, arg0: str) → None
set_generator(self: _kratos.Var, arg0: kratos::Generator) → None
set_size_param(self: _kratos.Var, arg0: int, arg1: _kratos.Var) → None
signed
sinks
size
slice_var
sliced_by_var
sources
type(self: _kratos.Var) → kratos::VarType
verilog_ln
width
class _kratos.VerilogModule
pass_manager(self: _kratos.VerilogModule) → _kratos.passes.PassManager
run_passes(self: _kratos.VerilogModule) → None
verilog_src(*args, **kwargs)

Overloaded function.

  1. verilog_src(self: _kratos.VerilogModule) -> Dict[str, str]
  2. verilog_src(self: _kratos.VerilogModule, arg0: _kratos.SystemVerilogCodeGenOptions) -> Dict[str, str]
_kratos.comment(*args, **kwargs)

Overloaded function.

  1. comment(arg0: str) -> _kratos.CommentStmt
  2. comment(arg0: str, arg1: int) -> _kratos.CommentStmt
_kratos.constant(*args, **kwargs)

Overloaded function.

  1. constant(arg0: int, arg1: int, arg2: bool) -> _kratos.Const
  2. constant(arg0: str, arg1: int) -> _kratos.Const
  3. constant(arg0: object, arg1: int, arg2: bool) -> _kratos.Var
_kratos.create_stub(arg0: kratos::Generator) → str
_kratos.create_wrapper_flatten(arg0: _kratos.Generator, arg1: str) → _kratos.Generator
_kratos.extract_event_info(arg0: _kratos.Generator) → List[kratos::EventInfo]
_kratos.fix_verilog_ln(arg0: _kratos.Generator, arg1: int) → None
_kratos.generate_sv_package_header(*args, **kwargs)

Overloaded function.

  1. generate_sv_package_header(arg0: _kratos.Generator, arg1: str, arg2: bool) -> Tuple[str, int]
  2. generate_sv_package_header(arg0: _kratos.Generator, arg1: str, arg2: bool) -> Tuple[str, int]
_kratos.get_fn_ln(*args, **kwargs)

Overloaded function.

  1. get_fn_ln() -> Optional[Tuple[str, int]]
  2. get_fn_ln(arg0: int) -> Optional[Tuple[str, int]]
_kratos.get_frame_local(*args, **kwargs)

Overloaded function.

  1. get_frame_local(arg0: int) -> dict
  2. get_frame_local() -> dict
_kratos.mock_hierarchy(arg0: _kratos.Generator, arg1: str) → None
_kratos.mux(*args, **kwargs)

Overloaded function.

  1. mux(arg0: _kratos.Var, arg1: _kratos.Var, arg2: _kratos.Var) -> _kratos.Expr
  2. mux(arg0: _kratos.Var, arg1: int, arg2: _kratos.Var) -> _kratos.Expr
  3. mux(arg0: _kratos.Var, arg1: _kratos.Var, arg2: int) -> _kratos.Expr