Repository navigation
rewind edited
muneebullashariff edited this page Jan 4, 2024
·
4 revisions
module file_eof;
int fd;
string str;
int dummy;
initial begin:BEGIN_I
//open the file in the write mode
fd = $fopen ("hihihi.sv", "w+");
//displays the contents into the file
$fdisplay(fd,"teams");
$fdisplay(fd,"c");
dummy = $rewind(fd);
$fdisplay(fd,"abcde");
//close the file
$fclose(fd);
//open the file in read mode
fd = $fopen("hihihi.sv","r");
dummy = $feof(fd);
$display("EOF=%0d",dummy);
repeat(3) begin
dummy = $fgets(str,fd);
$display("line:%0s",str);
end
dummy=$feof(fd);
$display("EOF=%0d",dummy);
$fclose(fd);
end:BEGIN_I
endmodule:file_eof


-
- Calling a function with values as arguments
- Calling a function with variables as arguments
- Calling a function with values from an expression
- Calling a function with variables with positional arguments
- calling an automatic function
- calling a function with variables with reference of variables
- calling a function with a void return type
- Calling a function by passing an array
- Calling a function by passing an array from display
- Calling a function with variables that had default values
- Calling a task from function(exceptional case by using fork and join_none)
-
- Random Function System
- Random Variables
- Std Randomize
- Constraint Block
- Array Randomization
- Inside Constraint
- Inverted Inside Constraint
- Weighted Distribution
- Bidirectional Constraint
- Implication Constraint
- if-else constraint
- foreach
- Solve before constraint
- Static Constraint
- Randomization methods
- Constraint conflict
- Inline Constraint
- Soft Constraint
- Disable Constraint
- Disable Randomization
- randcase
- constraint memory examples
-
- class
- class handle
- class constructor
- object
- this keyword
- super keyword
- Scope resolution and extern keyword
- Chaining Constructs
- Constant class properties
- copying objects
- parameterized classes
- virtual methods
- static properties and methods
- Over riding class members
- Inheritance
- Polymorphism
- Encapsulation
- Abstraction