Guest User

Untitled

a guest
Jan 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module proj1_test();
  2.   wire clk, reset; //clock and reset
  3.   reg [7:0] in;
  4.   wire [7:0] out; //input and output
  5.   reg eof;
  6.  
  7.   integer data_file;
  8.   initial
  9.     data_file=$fopen("proj1.dat", "rb");
  10.    
  11.  
  12.   always@(posedge clk)
  13.   begin
  14.     eof=$feof(data_file);
  15.     if(eof==0)
  16.       $fscanf(data_file, "%d", in);
  17.   end
  18.  
  19.  
  20.    
  21.   init #(4) my_init(reset, clk);
  22.  
  23.   project1 proj1(clk, reset, in, out);
  24.  
  25. endmodule
Add Comment
Please, Sign In to add comment