|
发表于 2015-8-31 20:55:24
|
显示全部楼层
粗略的写了一个例子,没编译过,你参考一下吧。主要用到的几个verilog函数都在里面了。
integer fp1, fp2, num;
integer data1, data2, data3;
initial begin
fp1 = $fopen("1.txt", r);
fp2 = $fopen("2.txt", w);
while(!$feof(fp1)) begin
num = $fscanf("%d %d %d", data1, data2, data3);
// update data1, data2, data3
$fwrite(fp2, "%d %d %d\n", data1, data2, data3);
end
$fclose(fp1);
$fclose(fp2);
end |
|