Skip to content

Commit

Permalink
Fix colon issue
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy committed Oct 31, 2024
1 parent 262f200 commit 001b6ef
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
14 changes: 13 additions & 1 deletion liberty/LibertyParse.yy
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ int LibertyLex_lex();
%token <string> STRING KEYWORD

%type <stmt> statement complex_attr simple_attr variable group file
%type <attr_values> attr_values
%type <attr_values> attr_values colon_expr
%type <attr_value> attr_value
%type <string> string expr expr_term expr_term1 volt_expr
%type <line> line
Expand Down Expand Up @@ -86,6 +86,10 @@ group:
{ sta::libertyGroupBegin($1, $3, $5); }
statements '}' semi_opt
{ $$ = sta::libertyGroupEnd(); }
| KEYWORD '(' colon_expr ')' line '{'
{ sta::libertyGroupBegin($1, $3, $5); }
statements '}' semi_opt
{ $$ = sta::libertyGroupEnd(); }
;

line: /* empty */
Expand Down Expand Up @@ -150,6 +154,14 @@ attr_value:
{ $$ = sta::makeLibertyStringAttrValue($1); }
| volt_expr
{ $$ = sta::makeLibertyStringAttrValue($1); }

/* Colon expressions are normal exprs with a ':' separator. */
colon_expr:
expr ':' expr
{ char *expr_str = sta::stringPrint("%s:%s", $1, $3);
$$ = new sta::LibertyAttrValueSeq;
$$->push_back(sta::makeLibertyStringAttrValue(expr_str));
}
;

/* Voltage expressions are ignored. */
Expand Down
51 changes: 51 additions & 0 deletions test/ccs_input_ccb_colon.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
library (ccs_input_ccb_colon) {
delay_model : "table_lookup";
simulation : false;
capacitive_load_unit (1,pF);
leakage_power_unit : "1pW";
current_unit : "1A";
pulling_resistance_unit : "1kohm";
time_unit : "1ns";
voltage_unit : "1v";
library_features : "report_delay_calculation";
input_threshold_pct_rise : 50;
input_threshold_pct_fall : 50;
output_threshold_pct_rise : 50;
output_threshold_pct_fall : 50;
slew_lower_threshold_pct_rise : 30;
slew_lower_threshold_pct_fall : 30;
slew_upper_threshold_pct_rise : 70;
slew_upper_threshold_pct_fall : 70;
slew_derate_from_library : 1.0;
nom_process : 1.0;
nom_temperature : 85.0;
nom_voltage : 0.75;

cell(ccs_input_ccb_colon) {
sensitization_master : sensitization_3pins ;
area : 0.1 ;
dont_touch : true ;
dont_use : true ;

pin(A) {
capacitance : 0.0001 ;
direction : input ;
driver_waveform_rise : "driver_waveform_default_rise" ;
driver_waveform_fall : "driver_waveform_default_fall" ;
fall_capacitance : 0.0001 ;
input_voltage : default ;
max_transition : 0.1 ;
related_ground_pin : VSS ;
related_power_pin : VDD ;
rise_capacitance : 0.0001 ;

input_ccb(ccs_input_ccb_colon:a) {
is_needed : true ;
is_inverting : true ;
miller_cap_fall : 0.0001 ;
miller_cap_rise : 1e-05 ;
stage_type : both ;
}
}
}
}
1 change: 1 addition & 0 deletions test/ccs_input_ccb_colon.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ccs_input_ccb_colon.lib read
3 changes: 3 additions & 0 deletions test/ccs_input_ccb_colon.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# test ccsn with input_ccb having a colon in group name
read_liberty ccs_input_ccb_colon.lib
puts "ccs_input_ccb_colon.lib read"
1 change: 1 addition & 0 deletions test/regression_vars.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ record_sta_tests {
get_noargs
get_objrefs
report_checks_src_attr
ccs_input_ccb_colon
}

define_test_group fast [group_tests all]

0 comments on commit 001b6ef

Please sign in to comment.