Download OpenTimer_OpenTimer/example/unit/unit.cpp from SAIFIINDUSTRIES/verilog_data-2: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/datasets/SAIFIINDUSTRIES/verilog_data-2/resolve/main/OpenTimer_OpenTimer/example/unit/unit.cpp
- Command line
-
hf download hf://datasets/SAIFIINDUSTRIES/verilog_data-2/OpenTimer_OpenTimer/example/unit/unit.cpp
-
curl -L -o unit.cpp https://huggingface.co/datasets/SAIFIINDUSTRIES/verilog_data-2/resolve/main/OpenTimer_OpenTimer/example/unit/unit.cpp
1.92 kB
| // This program demonstrates how to change units for | |
| // dimensional analysis. | |
| // | |
| // Design : unit.v | |
| // SDC : unit.sdc | |
| // SPEF : unit.spef | |
| // Library: osu018_stdcells.lib | |
| int main(int argc, char *argv[]) { | |
| ot::Timer timer; | |
| // read the design | |
| timer.read_celllib("osu018_stdcells.lib") | |
| .read_verilog("unit.v") | |
| .read_sdc("unit.sdc") | |
| .read_spef("unit.spef") | |
| .update_timing(); | |
| // the default library is at ns and pf scale. | |
| std::cout << timer.time_unit()->value() << " second (time unit)\n" | |
| << timer.capacitance_unit()->value() << " farad (capacitance unit)\n" | |
| << "TNS: " << *timer.report_tns() << '\n'; | |
| // change to ps and ff. | |
| timer.set_time_unit(ot::second_t(1e-12)) | |
| .set_capacitance_unit(ot::farad_t(1e-15)) | |
| .update_timing(); | |
| // dump the timer details | |
| std::cout << timer.time_unit()->value() << " second (time unit)\n" | |
| << timer.capacitance_unit()->value() << " farad (capacitance unit)\n" | |
| << "TNS: " << *timer.report_tns() << '\n'; | |
| // change back to ns and pf | |
| timer.set_time_unit(ot::second_t(1e-9)) | |
| .set_capacitance_unit(ot::farad_t(1e-12f)) | |
| .update_timing(); | |
| // dump the timer details | |
| std::cout << timer.time_unit()->value() << " second (time unit)\n" | |
| << timer.capacitance_unit()->value() << " farad (capacitance unit)\n" | |
| << "TNS: " << *timer.report_tns() << '\n'; | |
| // scale the time unit by half | |
| timer.set_time_unit(ot::second_t(2e-9)) | |
| .set_capacitance_unit(ot::farad_t(2e-12f)) | |
| .update_timing(); | |
| // dump the timer details | |
| std::cout << timer.time_unit()->value() << " second (time unit)\n" | |
| << timer.capacitance_unit()->value() << " farad (capacitance unit)\n" | |
| << "TNS: " << *timer.report_tns() << '\n'; | |
| return 0; | |
| } | |