mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-30 13:19:05 +00:00
Add $input_port
and $connect
cell types
This commit is contained in:
parent
c4f435569f
commit
1251e92e3a
4 changed files with 63 additions and 0 deletions
|
@ -111,6 +111,8 @@ struct CellTypes
|
|||
setup_type(ID($original_tag), {ID::A}, {ID::Y});
|
||||
setup_type(ID($future_ff), {ID::A}, {ID::Y});
|
||||
setup_type(ID($scopeinfo), {}, {});
|
||||
setup_type(ID($input_port), {}, {ID::Y});
|
||||
setup_type(ID($connect), {ID::A, ID::B}, {});
|
||||
}
|
||||
|
||||
void setup_internals_eval()
|
||||
|
|
|
@ -2451,6 +2451,19 @@ namespace {
|
|||
check_expected();
|
||||
return;
|
||||
}
|
||||
if (cell->type.in(ID($input_port))) {
|
||||
param(ID::WIDTH);
|
||||
port(ID::Y, param(ID::WIDTH));
|
||||
check_expected();
|
||||
return;
|
||||
}
|
||||
if (cell->type.in(ID($connect))) {
|
||||
param(ID::WIDTH);
|
||||
port(ID::A, param(ID::WIDTH));
|
||||
port(ID::B, param(ID::WIDTH));
|
||||
check_expected();
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* Checklist for adding internal cell types
|
||||
* ========================================
|
||||
|
|
|
@ -3216,3 +3216,26 @@ module \$scopeinfo ();
|
|||
parameter TYPE = "";
|
||||
|
||||
endmodule
|
||||
|
||||
// --------------------------------------------------------
|
||||
//* group wire
|
||||
module \$connect (A, B);
|
||||
|
||||
parameter WIDTH = 0;
|
||||
|
||||
inout [WIDTH-1:0] A;
|
||||
inout [WIDTH-1:0] B;
|
||||
|
||||
tran connect[WIDTH-1:0] (A, B);
|
||||
|
||||
endmodule
|
||||
|
||||
// --------------------------------------------------------
|
||||
//* group wire
|
||||
module \$input_port (Y);
|
||||
|
||||
parameter WIDTH = 0;
|
||||
|
||||
inout [WIDTH-1:0] Y;
|
||||
|
||||
endmodule
|
||||
|
|
|
@ -647,3 +647,28 @@ module _90_lut;
|
|||
endmodule
|
||||
`endif
|
||||
|
||||
|
||||
// --------------------------------------------------------
|
||||
// Bufnorm helpers
|
||||
// --------------------------------------------------------
|
||||
|
||||
(* techmap_celltype = "$connect" *)
|
||||
module \$connect (A, B);
|
||||
|
||||
parameter WIDTH = 0;
|
||||
|
||||
inout [WIDTH-1:0] A;
|
||||
inout [WIDTH-1:0] B;
|
||||
|
||||
assign A = B; // RTLIL assignments are not inherently directed
|
||||
|
||||
endmodule
|
||||
|
||||
(* techmap_celltype = "$input_port" *)
|
||||
module \$input_port (Y);
|
||||
|
||||
parameter WIDTH = 0;
|
||||
|
||||
inout [WIDTH-1:0] Y; // This cell is just a maker, so we leave Y undriven
|
||||
|
||||
endmodule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue