Progress on cell help messages

This commit is contained in:
Clifford Wolf 2015-10-17 02:22:42 +02:00
parent 255bb914ba
commit 5d1c0ce7c0
3 changed files with 107 additions and 54 deletions

View File

@ -644,7 +644,7 @@ struct HelpPass : public Pass {
for (auto &it : cell_help_messages.cell_help) {
string line = split_tokens(it.second, "\n").at(0);
string cell_name = next_token(line);
log(" %-10s %s\n", cell_name.c_str(), line.c_str());
log(" %-15s %s\n", cell_name.c_str(), line.c_str());
}
log("\n");
log("Type 'help <cell_type>' for more information on a cell type.\n");

View File

@ -6,6 +6,7 @@ import json
current_help_msg = []
current_module_code = []
current_module_name = None
current_module_signature = None
def print_current_cell():
print("cell_help[\"%s\"] = %s;" % (current_module_name, "\n".join([json.dumps(line) for line in current_help_msg])))
@ -16,10 +17,18 @@ for line in fileinput.input():
current_help_msg.append(line[4:] if len(line) > 4 else "\n")
if line.startswith("module "):
current_module_name = line.split()[1].strip("\\")
current_module_signature = " ".join(line.replace("\\", "").replace(";", "").split()[1:])
current_module_code = []
current_module_code.append(line)
elif not line.startswith("endmodule"):
line = " " + line
current_module_code.append(line.replace("\t", " "))
if line.startswith("endmodule"):
if len(current_help_msg) > 0:
if len(current_help_msg) == 0:
current_help_msg.append("\n")
current_help_msg.append(" %s\n" % current_module_signature)
current_help_msg.append("\n")
current_help_msg.append("No help message for this cell type found.\n")
current_help_msg.append("\n")
print_current_cell()
current_help_msg = []

View File

@ -504,7 +504,7 @@ endmodule
//- Truth table: D C | Q
//- -----+---
//- d \ | d
//- - = | q
//- - - | q
//-
module \$_DFF_N_ (D, Q, C);
input D, C;
@ -523,7 +523,7 @@ endmodule
//- Truth table: D C | Q
//- -----+---
//- d / | d
//- - = | q
//- - - | q
//-
module \$_DFF_P_ (D, Q, C);
input D, C;
@ -533,6 +533,17 @@ always @(posedge C) begin
end
endmodule
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
//-
//- $_DFFE_NN_ (D, C, E, Q)
//-
//- A negative edge D-type flip-flop with negative polarity enable.
//-
//- Truth table: D C E | Q
//- -------+---
//- d \ 0 | d
//- - - - | q
//-
module \$_DFFE_NN_ (D, Q, C, E);
input D, C, E;
output reg Q;
@ -541,6 +552,17 @@ always @(negedge C) begin
end
endmodule
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
//-
//- $_DFFE_NP_ (D, C, E, Q)
//-
//- A negative edge D-type flip-flop with positive polarity enable.
//-
//- Truth table: D C E | Q
//- -------+---
//- d \ 1 | d
//- - - - | q
//-
module \$_DFFE_NP_ (D, Q, C, E);
input D, C, E;
output reg Q;
@ -549,6 +571,17 @@ always @(negedge C) begin
end
endmodule
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
//-
//- $_DFFE_PN_ (D, C, E, Q)
//-
//- A positive edge D-type flip-flop with negative polarity enable.
//-
//- Truth table: D C E | Q
//- -------+---
//- d / 0 | d
//- - - - | q
//-
module \$_DFFE_PN_ (D, Q, C, E);
input D, C, E;
output reg Q;
@ -557,6 +590,17 @@ always @(posedge C) begin
end
endmodule
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
//-
//- $_DFFE_PP_ (D, C, E, Q)
//-
//- A positive edge D-type flip-flop with positive polarity enable.
//-
//- Truth table: D C E | Q
//- -------+---
//- d / 1 | d
//- - - - | q
//-
module \$_DFFE_PP_ (D, Q, C, E);
input D, C, E;
output reg Q;