This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function void writing_binary_file(int unsigned total_bytes_to_write=32); | |
| int fwrite; | |
| bit [7:0] wdata; | |
| //Open file with binary write mode("wb"), b here specifies binary | |
| fwrite=$fopen("binary_file.bin","wb"); | |
| if(fwrite==0) | |
| `uvm_error("NO_FILE_FOUND","Couldn't open file binary_file.bin for writing") | |
| //iterate until all intended bytes are written |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function void read_binary_file(); | |
| int fread; | |
| bit [7:0] rdata; | |
| int unsigned line_count; | |
| line_count=0; | |
| //Open file with binary read mode("rb"), b here specifies binary | |
| fread=$fopen("binary_file.bin","rb"); | |
| if(fread==0) | |
| `uvm_error("NO_FILE_FOUND","Couldn't open file binary_file.bin for reading") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task parse_file_sv(); | |
| int samplefile; | |
| string line_from_file, sub1; | |
| real sub2; | |
| string srcdir; | |
| if($value$plusargs("SRCDIR=%s", srcdir)) | |
| `uvm_info(get_name(), $sformatf("+SRCDIR:%s",srcdir),UVM_MEDIUM) | |
| else | |
| `uvm_error(get_name(), $sformatf("+SRCDIR is not passed")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //design example | |
| module design_module( | |
| input logic enable, | |
| input logic reset, | |
| input logic clk, | |
| output logic active); | |
| logic [1:0] fsm_cs;//current state | |
| logic [1:0] fsm_ns;//next state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //design example | |
| module design_module( | |
| input logic enable, | |
| input logic reset, | |
| input logic clk, | |
| output logic active); | |
| logic [1:0] fsm_cs;//current state | |
| logic [1:0] fsm_ns;//next state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #start GUI | |
| icc_shell>start_gui | |
| #report max transition constaints | |
| icc_shell> report_constraint -max_transition -verbose | |
| #report timing with transition with pins (through that pin) | |
| icc_shell> report_timing -thr <instance_name>/<pin_name> |