Skip to content

Commit

Permalink
[Ibis] Rename to 'Kanagawa'
Browse files Browse the repository at this point in the history
  • Loading branch information
teqdruid committed Nov 18, 2024
1 parent 026976a commit e7bb7e8
Show file tree
Hide file tree
Showing 96 changed files with 2,701 additions and 2,672 deletions.
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ lib/Target/ExportSMTLIB @maerhart
# SV
**/Dialect/SV @darthscsi

# Ibis
**/Dialect/Ibis @teqdruid @mortbopet @blakep-msft
# Kanagawa
**/Dialect/Kanagawa @teqdruid @mortbopet @blakep-msft


## Infra
Expand Down
3 changes: 0 additions & 3 deletions docs/Dialects/Ibis/_index.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# `ibis` Dialect Rationale
# `kanagawa` Dialect Rationale

## Lowering flow

1. Containerization:
At this level, one may have relative references to ports `get_port` accesses
to `!ibis.scoperef`s
to `!kanagawa.scoperef`s
2. Tunneling:
Relative `!ibis.scoperef` references are defined via `ibis.path` operations.
In this pass, we lower `ibis.path` operations by tunneling `portref`s through
Relative `!kanagawa.scoperef` references are defined via `kanagawa.path` operations.
In this pass, we lower `kanagawa.path` operations by tunneling `portref`s through
the instance hierarchy, based on the `get_port` operations that were present
in the various containers. After this, various `portref<in portref<#dir, T>>`
ports are present in the design, which represents the actual ports that are
Expand All @@ -27,9 +27,9 @@
In cases where children drive parent ports, the prior case may create
situations where a container drives its own input ports (and by extension, no
other instantiating container is expected to drive that port of the instance,
if the IR is correct). We thus run `ibis-clean-selfdrivers` to replace these
if the IR is correct). We thus run `kanagawa-clean-selfdrivers` to replace these
self-driven ports by the actual values that are being driven into them.
5. HW lowering:
At this point, there no longer exist any relative references in the Ibis IR,
At this point, there no longer exist any relative references in the Kanagawa IR,
and all instantiations should (if the IR is correct) have all of their inputs
driven. This means that we can now lower the IR to `hw.module`s.
3 changes: 3 additions & 0 deletions docs/Dialects/Kanagawa/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 'kanagawa' Dialect

[include "Dialects/Kanagawa.md"]
4 changes: 2 additions & 2 deletions docs/Passes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ This document describes the available CIRCT passes and their contracts.

[include "HWPasses.md"]

## Ibis Dialect Passes
## Kanagawa Dialect Passes

[include "IbisPasses.md"]
[include "KanagawaPasses.md"]

## LLHD Dialect Passes

Expand Down
2 changes: 1 addition & 1 deletion include/circt/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ add_subdirectory(Moore)
add_subdirectory(MSFT)
add_subdirectory(OM)
add_subdirectory(Pipeline)
add_subdirectory(Ibis)
add_subdirectory(Kanagawa)
add_subdirectory(Seq)
add_subdirectory(Sim)
add_subdirectory(SMT)
Expand Down
21 changes: 0 additions & 21 deletions include/circt/Dialect/Ibis/CMakeLists.txt

This file was deleted.

29 changes: 0 additions & 29 deletions include/circt/Dialect/Ibis/IbisPassPipelines.h

This file was deleted.

21 changes: 21 additions & 0 deletions include/circt/Dialect/Kanagawa/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
add_circt_dialect(Kanagawa kanagawa)
add_circt_dialect_doc(Kanagawa kanagawa)

set(LLVM_TARGET_DEFINITIONS KanagawaPasses.td)
mlir_tablegen(KanagawaPasses.h.inc -gen-pass-decls)
add_public_tablegen_target(CIRCTKanagawaTransformsIncGen)
add_circt_doc(KanagawaPasses KanagawaPasses -gen-pass-doc)

set(LLVM_TARGET_DEFINITIONS KanagawaInterfaces.td)
mlir_tablegen(KanagawaInterfaces.h.inc -gen-op-interface-decls)
mlir_tablegen(KanagawaInterfaces.cpp.inc -gen-op-interface-defs)
add_public_tablegen_target(MLIRKanagawaInterfacKanagawancGen)
add_dependencies(circt-headers MLIRKanagawaInterfacKanagawancGen)

set(LLVM_TARGET_DEFINITIONS Kanagawa.td)
mlir_tablegen(KanagawaEnums.h.inc -gen-enum-decls)
mlir_tablegen(KanagawaEnums.cpp.inc -gen-enum-defs)
mlir_tablegen(KanagawaAttributes.h.inc -gen-attrdef-decls -attrdefs-dialect=kanagawa)
mlir_tablegen(KanagawaAttributes.cpp.inc -gen-attrdef-defs -attrdefs-dialect=kanagawa)
add_public_tablegen_target(MLIRKanagawaEnumsIncGen)
add_dependencies(circt-headers MLIRKanagawaEnumsIncGen)
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
//===- Ibis.td - Definition of Ibis dialect -------------------------------===//
//===- Kanagawa.td - Definition of Kanagawa dialect -----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef CIRCT_DIALECT_IBIS_TD
#define CIRCT_DIALECT_IBIS_TD
#ifndef CIRCT_DIALECT_KANAGAWA_TD
#define CIRCT_DIALECT_KANAGAWA_TD

include "mlir/IR/AttrTypeBase.td"
include "mlir/IR/OpBase.td"
include "mlir/Interfaces/FunctionInterfaces.td"

include "circt/Dialect/Ibis/IbisDialect.td"
include "circt/Dialect/Ibis/IbisTypes.td"
include "circt/Dialect/Ibis/IbisOps.td"
include "circt/Dialect/Kanagawa/KanagawaDialect.td"
include "circt/Dialect/Kanagawa/KanagawaTypes.td"
include "circt/Dialect/Kanagawa/KanagawaOps.td"

#endif // CIRCT_DIALECT_IBIS_TD
#endif // CIRCT_DIALECT_KANAGAWA_TD
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//===- IbisDialect.h - Definition of Ibis dialect ----------------*- C++-*-===//
//===- KanagawaDialect.h - Definition of Kanagawa dialect -------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef CIRCT_DIALECT_IBIS_IBISDIALECT_H
#define CIRCT_DIALECT_IBIS_IBISDIALECT_H
#ifndef CIRCT_DIALECT_KANAGAWA_KANAGAWADIALECT_H
#define CIRCT_DIALECT_KANAGAWA_KANAGAWADIALECT_H

#include "mlir/IR/Dialect.h"

// Pull in the dialect definition.
#include "circt/Dialect/Ibis/IbisDialect.h.inc"
#include "circt/Dialect/Kanagawa/KanagawaDialect.h.inc"

// Pull in all enum type definitions and utility function declarations.
#include "circt/Dialect/Ibis/IbisEnums.h.inc"
#include "circt/Dialect/Kanagawa/KanagawaEnums.h.inc"

#define GET_ATTRDEF_CLASSES
#include "circt/Dialect/Ibis/IbisAttributes.h.inc"
#include "circt/Dialect/Kanagawa/KanagawaAttributes.h.inc"

#endif // CIRCT_DIALECT_IBIS_IBISDIALECT_H
#endif // CIRCT_DIALECT_KANAGAWA_KANAGAWADIALECT_H
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//===- IbisDialect.td - Ibis dialect definition ----------------*- tablegen -*-===//
//===- KanagawaDialect.td - Kanagawa dialect definition ----*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef CIRCT_DIALECT_IBIS_DIALECT_TD
#define CIRCT_DIALECT_IBIS_DIALECT_TD
#ifndef CIRCT_DIALECT_KANAGAWA_DIALECT_TD
#define CIRCT_DIALECT_KANAGAWA_DIALECT_TD

include "mlir/IR/OpBase.td"

def IbisDialect : Dialect {
let name = "ibis";
let cppNamespace = "::circt::ibis";
def KanagawaDialect : Dialect {
let name = "kanagawa";
let cppNamespace = "::circt::kanagawa";

let summary = "Types and operations for Ibis dialect";
let summary = "Types and operations for Kanagawa dialect";
let description = [{
The `ibis` dialect is intended to support porting and eventual open sourcing
The `kanagawa` dialect is intended to support porting and eventual open sourcing
of an internal hardware development language.
}];
let useDefaultTypePrinterParser = 1;
Expand All @@ -27,8 +27,8 @@ def IbisDialect : Dialect {
void registerAttributes();
}];

// Needed for ibis.pipeline_header
// Needed for kanagawa.pipeline_header
let dependentDialects = ["seq::SeqDialect", "hw::HWDialect"];
}

#endif // CIRCT_DIALECT_IBIS_DIALECT_TD
#endif // CIRCT_DIALECT_KANAGAWA_DIALECT_TD
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
//===- IbisInterfaces.td - Ibis Interfaces ---------------*- tablegen -*---===//
//===- KanagawaInterfaces.td - Kanagawa Interfaces -------*- tablegen -*---===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This describes the interfaces in the Ibis dialect.
// This describes the interfaces in the Kanagawa dialect.
//
//===----------------------------------------------------------------------===//

#ifndef CIRCT_DIALECT_IBIS_INTERFACES_TD
#define CIRCT_DIALECT_IBIS_INTERFACES_TD
#ifndef CIRCT_DIALECT_KANAGAWA_INTERFACES_TD
#define CIRCT_DIALECT_KANAGAWA_INTERFACES_TD

include "circt/Dialect/HW/HWOpInterfaces.td"

include "mlir/IR/OpBase.td"
include "mlir/IR/SymbolInterfaces.td"

def NamedInnerSymbol : OpInterface<"NamedInnerSymbolInterface", [InnerSymbol]> {
let cppNamespace = "circt::ibis";
let cppNamespace = "circt::kanagawa";
let description = [{
An interface for operations which define inner symbols with an optional
namehint.
Expand Down Expand Up @@ -50,7 +50,7 @@ def NamedInnerSymbol : OpInterface<"NamedInnerSymbolInterface", [InnerSymbol]> {
}

def PortOpInterface : OpInterface<"PortOpInterface", [NamedInnerSymbol]> {
let cppNamespace = "circt::ibis";
let cppNamespace = "circt::kanagawa";
let description =
"An interface for operations which describe ports.";

Expand All @@ -59,17 +59,17 @@ def PortOpInterface : OpInterface<"PortOpInterface", [NamedInnerSymbol]> {
"Returns the data type of the port.",
"mlir::Type", "getPortType">,
InterfaceMethod<
"Returns the `!ibis.portref` value defined by the op",
"Returns the `!kanagawa.portref` value defined by the op",
"mlir::TypedValue<PortRefType>", "getPort"
>
];
}

def ScopeOpInterface : OpInterface<"ScopeOpInterface", [NamedInnerSymbol]> {
let cppNamespace = "circt::ibis";
let cppNamespace = "circt::kanagawa";
let description = [{
An interface for operations which define Ibis scopes, that can be referenced
by an `ibis.this` operation.
An interface for operations which define Kanagawa scopes, that can be referenced
by an `kanagawa.this` operation.
}];

let verify = "return detail::verifyScopeOpInterface($_op);";
Expand Down Expand Up @@ -125,20 +125,20 @@ def ScopeOpInterface : OpInterface<"ScopeOpInterface", [NamedInnerSymbol]> {
>,
InterfaceMethod<
"Lookup a port in the scope",
"ibis::PortOpInterface", "lookupPort",
"kanagawa::PortOpInterface", "lookupPort",
(ins "llvm::StringRef":$portName),
[{}],
[{
return dyn_cast_or_null<ibis::PortOpInterface>(this->lookupInnerSym(portName));
return dyn_cast_or_null<kanagawa::PortOpInterface>(this->lookupInnerSym(portName));
}]
>
];
}

def BlockOpInterface : OpInterface<"BlockOpInterface"> {
let cppNamespace = "circt::ibis";
let cppNamespace = "circt::kanagawa";
let description = [{
An interface for Ibis block-like operations.
An interface for Kanagawa block-like operations.
}];

let methods = [
Expand All @@ -150,11 +150,11 @@ def BlockOpInterface : OpInterface<"BlockOpInterface"> {
}

def MethodLikeOpInterface : OpInterface<"MethodLikeOpInterface"> {
let cppNamespace = "circt::ibis";
let cppNamespace = "circt::kanagawa";
let description = [{
An interface for Ibis operations that act like callable methods.
An interface for Kanagawa operations that act like callable methods.
This partially implements similar functionality to the FunctionLike interface
which cannot be used for Ibis Methods due to Ibis methods defining InnerSym's
which cannot be used for Kanagawa Methods due to Kanagawa methods defining InnerSym's
whereas the FunctionLike interface is built on the assumption of the function
defining a Symbol (i.e. inherits from the Symbol interface).
}];
Expand Down Expand Up @@ -199,4 +199,4 @@ def MethodLikeOpInterface : OpInterface<"MethodLikeOpInterface"> {
}];
}

#endif // CIRCT_DIALECT_IBIS_INTERFACES_TD
#endif // CIRCT_DIALECT_KANAGAWA_INTERFACES_TD
Loading

0 comments on commit e7bb7e8

Please sign in to comment.