Skip to content

Commit

Permalink
remove hw and support
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <[email protected]>

fix include

Signed-off-by: Asra Ali <[email protected]>
  • Loading branch information
asraa committed Sep 27, 2023
1 parent 3227c80 commit eab2b70
Show file tree
Hide file tree
Showing 115 changed files with 132 additions and 21,192 deletions.
1 change: 0 additions & 1 deletion include/circt/Dialect/Comb/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ td_library(
],
includes = ["include"],
deps = [
"@heir//include/circt/Dialect/HW:td_files",
"@llvm-project//mlir:BuiltinDialectTdFiles",
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
"@llvm-project//mlir:FunctionInterfacesTdFiles",
Expand Down
14 changes: 0 additions & 14 deletions include/circt/Dialect/Comb/CMakeLists.txt

This file was deleted.

5 changes: 2 additions & 3 deletions include/circt/Dialect/Comb/Comb.td
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def CombDialect : Dialect {
This dialect defines the `comb` dialect, which is intended to be a generic
representation of combinational logic outside of a particular use-case.
}];
let hasConstantMaterializer = 1;
// let hasConstantMaterializer = 1;
let cppNamespace = "::circt::comb";

// This will be the default after next LLVM bump.
Expand All @@ -38,7 +38,6 @@ def CombDialect : Dialect {
class CombOp<string mnemonic, list<Trait> traits = []> :
Op<CombDialect, mnemonic, traits>;

include "include/circt/Dialect/HW/HWTypes.td"
include "include/circt/Dialect/Comb/Combinational.td"
include "Combinational.td"

#endif // COMB_TD
45 changes: 24 additions & 21 deletions include/circt/Dialect/Comb/CombOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define CIRCT_DIALECT_COMB_COMBOPS_H

#include "include/circt/Dialect/Comb/CombDialect.h"
#include "include/circt/Dialect/HW/HWTypes.h"
#include "include/circt/Support/LLVM.h"
#include "mlir/include/mlir/Bytecode/BytecodeOpInterface.h" // from @llvm-project
#include "mlir/include/mlir/IR/BuiltinOps.h" // from @llvm-project
Expand All @@ -34,30 +33,34 @@ class PatternRewriter;
#define GET_OP_CLASSES
#include "include/circt/Dialect/Comb/Comb.h.inc"

namespace circt {
namespace comb {
// namespace circt {
// namespace comb {

using llvm::KnownBits;
// using llvm::KnownBits;

/// Compute "known bits" information about the specified value - the set of bits
/// that are guaranteed to always be zero, and the set of bits that are
/// guaranteed to always be one (these must be exclusive!). A bit that exists
/// in neither set is unknown.
KnownBits computeKnownBits(Value value);
// /// Compute "known bits" information about the specified value - the set of
// bits
// /// that are guaranteed to always be zero, and the set of bits that are
// /// guaranteed to always be one (these must be exclusive!). A bit that
// exists
// /// in neither set is unknown.
// KnownBits computeKnownBits(Value value);

/// Create a sign extension operation from a value of integer type to an equal
/// or larger integer type.
Value createOrFoldSExt(Location loc, Value value, Type destTy,
OpBuilder &builder);
Value createOrFoldSExt(Value value, Type destTy, ImplicitLocOpBuilder &builder);
// /// Create a sign extension operation from a value of integer type to an
// equal
// /// or larger integer type.
// Value createOrFoldSExt(Location loc, Value value, Type destTy,
// OpBuilder &builder);
// Value createOrFoldSExt(Value value, Type destTy, ImplicitLocOpBuilder
// &builder);

/// Create a ``Not'' gate on a value.
Value createOrFoldNot(Location loc, Value value, OpBuilder &builder,
bool twoState = false);
Value createOrFoldNot(Value value, ImplicitLocOpBuilder &builder,
bool twoState = false);
// /// Create a ``Not'' gate on a value.
// Value createOrFoldNot(Location loc, Value value, OpBuilder &builder,
// bool twoState = false);
// Value createOrFoldNot(Value value, ImplicitLocOpBuilder &builder,
// bool twoState = false);

} // namespace comb
} // namespace circt
// } // namespace comb
// } // namespace circt

#endif // CIRCT_DIALECT_COMB_COMBOPS_H
33 changes: 0 additions & 33 deletions include/circt/Dialect/Comb/CombPasses.h

This file was deleted.

113 changes: 0 additions & 113 deletions include/circt/Dialect/Comb/CombVisitors.h

This file was deleted.

52 changes: 28 additions & 24 deletions include/circt/Dialect/Comb/Combinational.td
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
include "mlir/Interfaces/InferTypeOpInterface.td"
include "mlir/IR/EnumAttr.td"

def HWIntegerType : Type<
CPred<"$_self.isSignlessInteger()">, "signless integer",
"::mlir::IntegerType">;

// Base class for binary operators.
class BinOp<string mnemonic, list<Trait> traits = []> :
CombOp<mnemonic, traits # [Pure]> {
Expand Down Expand Up @@ -45,8 +49,8 @@ class UTVariadicOp<string mnemonic, list<Trait> traits = []> :
VariadicOp<mnemonic,
traits # [SameTypeOperands, SameOperandsAndResultType]> {

let hasCanonicalizeMethod = true;
let hasFolder = true;
// let hasCanonicalizeMethod = true;
// let hasFolder = true;
let hasVerifier = 1;

let assemblyFormat = "(`bin` $twoState^)? $inputs attr-dict `:` qualified(type($result))";
Expand All @@ -62,18 +66,18 @@ class UTVariadicOp<string mnemonic, list<Trait> traits = []> :
// Arithmetic and Logical Operations.
def AddOp : UTVariadicOp<"add", [Commutative]>;
def MulOp : UTVariadicOp<"mul", [Commutative]>;
let hasFolder = true in {
def DivUOp : UTBinOp<"divu">;
def DivSOp : UTBinOp<"divs">;
def ModUOp : UTBinOp<"modu">;
def ModSOp : UTBinOp<"mods">;
let hasCanonicalizeMethod = true in {
def ShlOp : UTBinOp<"shl">;
def ShrUOp : UTBinOp<"shru">;
def ShrSOp : UTBinOp<"shrs">;
def SubOp : UTBinOp<"sub">;
}
}
// let hasFolder = true in {
// def DivUOp : UTBinOp<"divu">;
// def DivSOp : UTBinOp<"divs">;
// def ModUOp : UTBinOp<"modu">;
// def ModSOp : UTBinOp<"mods">;
// let hasCanonicalizeMethod = true in {
// def ShlOp : UTBinOp<"shl">;
// def ShrUOp : UTBinOp<"shru">;
// def ShrSOp : UTBinOp<"shrs">;
// def SubOp : UTBinOp<"sub">;
// }
// }

def AndOp : UTVariadicOp<"and", [Commutative]>;
def OrOp : UTVariadicOp<"or", [Commutative]>;
Expand Down Expand Up @@ -132,8 +136,8 @@ def ICmpOp : CombOp<"icmp", [Pure, SameTypeOperands]> {

let assemblyFormat = "(`bin` $twoState^)? $predicate $lhs `,` $rhs attr-dict `:` qualified(type($lhs))";

let hasFolder = true;
let hasCanonicalizeMethod = true;
// let hasFolder = true;
// let hasCanonicalizeMethod = true;

let extraClassDeclaration = [{
/// Returns the flipped predicate, reversing the LHS and RHS operands. The
Expand Down Expand Up @@ -166,7 +170,7 @@ class UnaryI1ReductionOp<string mnemonic, list<Trait> traits = []> :
CombOp<mnemonic, traits # [Pure]> {
let arguments = (ins HWIntegerType:$input, UnitAttr:$twoState);
let results = (outs I1:$result);
let hasFolder = 1;
// let hasFolder = 1;

let assemblyFormat = "(`bin` $twoState^)? $input attr-dict `:` qualified(type($input))";
}
Expand All @@ -188,9 +192,9 @@ def ExtractOp : CombOp<"extract", [Pure]> {
let assemblyFormat =
"$input `from` $lowBit attr-dict `:` functional-type($input, $result)";

let hasFolder = true;
// let hasFolder = true;
let hasVerifier = 1;
let hasCanonicalizeMethod = true;
// let hasCanonicalizeMethod = true;

let builders = [
OpBuilder<(ins "Value":$lhs, "int32_t":$lowBit, "int32_t":$bitWidth), [{
Expand All @@ -212,8 +216,8 @@ def ConcatOp : CombOp<"concat", [InferTypeOpInterface, Pure]> {
let arguments = (ins Variadic<HWIntegerType>:$inputs);
let results = (outs HWIntegerType:$result);

let hasFolder = true;
let hasCanonicalizeMethod = true;
// let hasFolder = true;
// let hasCanonicalizeMethod = true;
let hasVerifier = 1;

let assemblyFormat = "$inputs attr-dict `:` qualified(type($inputs))";
Expand Down Expand Up @@ -246,7 +250,7 @@ def ReplicateOp : CombOp<"replicate", [Pure]> {
let assemblyFormat =
"$input attr-dict `:` functional-type($input, $result)";

let hasFolder = true;
// let hasFolder = true;
let hasVerifier = 1;

let builders = [
Expand Down Expand Up @@ -283,8 +287,8 @@ def MuxOp : CombOp<"mux",
let assemblyFormat =
"(`bin` $twoState^)? $cond `,` $trueValue `,` $falseValue attr-dict `:` qualified(type($result))";

let hasFolder = true;
let hasCanonicalizer = true;
// let hasFolder = true;
// let hasCanonicalizer = true;
}

def TruthTableOp : CombOp<"truth_table", [Pure]> {
Expand Down
25 changes: 0 additions & 25 deletions include/circt/Dialect/Comb/Passes.td

This file was deleted.

Loading

0 comments on commit eab2b70

Please sign in to comment.