小技巧

1.Matlab数据保存到txt
fid = fopen(‘b.txt’,‘wt’);
fprintf(fid,’%g\n’,a); \n 换行
fclose(fid);

2.读取txt文件到matlab
load(‘data.txt’)
3.SPI EMIO引脚命名

单精度浮点数有效数字保证6位,部分7位
双精度浮点数有效数字保证15位,部分16位
对于单精度浮点数,精度为(尾数的位数)24位,合十进制有效位数7位; 对于双精度浮点数,精度为(尾数的位数)53位,合十进制有效位数15~16位
5.verilog操作符优先级

6.
integer data_file ; // file handler
integer scan_file ; // file handler
logic signed [21:0] captured_data;
`define NULL 0

initial begin
data_file = $fopen(“data_file.dat”, “r”);
if (data_file == `NULL) begin
$display(“data_file handle was NULL”);
$finish;
end
end

always @(posedge clk) begin
scan_file = f s c a n f ( d a t a f i l e , " i f ( ! fscanf(data_file, "%d\n", captured_data); if (! fscanf(datafile,"if(!feof(data_file)) begin
//use captured_data as you would any other wire or reg value;
end
end

integer data_file;
integer scan_file;
reg [31:0] txt_data;
reg [31:0] din;

initial
begin
    data_file=$fopen("test.txt","r");
    if(data_file == 0)
    begin
        $display("data_file handle was NULL");
        $finish;
    end
end


always @( posedge clock )
begin
    
    if( cnt > 'd200 )
    begin
        scan_file   = $fscanf(data_file, "%d\n", txt_data);
        //if(!$feof(data_file))
        //begin
            din <= txt_data;
        //end
    end
end

integer fp_w;

initial
begin
    fp_w = $fopen("data_out.txt”,”w”);
end

always @( posedge clock )
begin
    if( cnt > 'd201 )
    begin
        $fwrite(fp_w,"%d\n",din);
    end
end

输出c和d两个信号,约束c的输出寄存器放到IOB里,d的不允许。约束方法有两种,选中cd port,注意不是OBUF,在I/O Port的属性中添加IOB属性,设置为TRUE(允许)或FALSE(不允许),可以看到默认的都为Auto。在xdc文件中会生成约束命令。

set_property IOB TRUE [get_ports c]
set_property IOB FALSE [get_ports d]

实际工程中也可以用下面的语句约束全部输入输出。

set_property IOB TRUE [all_inputs]
set_property IOB FALSE [all_outputs]

fprintf中有一个格式为’%tx’,该格式就是打印成单精度浮点(float)形式的;
fprintf中有一个格式为’%bx’,该格式就是打印成双精度浮点(double)形式的。

-timescale 1ns/1ns -override_timeunit -override_timeprecision

64bit->8bit,先输出高8bit,然后依次输出。

SVN commit时,部分文件可以上传成功,有的文件上传时提示commit failed,提示拒绝访问。
将https改为http问题解决。
选择控制台树中的根节点,右键选择“属性”。
切换至面板“网络”。
取消勾选项“使用安全连接协议(https://)”。
13. 实际测试中并未发现AXI-MIG有4K边界的问题,而且对于存储设备4K的限制也没有意义。
14.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值