#include <stdio.h> 表示這個stdio.h在某個資料夾下,非當下的資料夾
#include "stdio.h" 才是當下的資料夾下面有stdio.h
使用#include表示將某檔案加入專案,但是有一種加入方式是利用IDE(編譯器)加入,若已經使用IDE加入,就不需要使用#include
2012年9月24日 星期一
2012年9月17日 星期一
microblaze example code
SPI
1.須將所有相關code 加到src中 ,設定正確device id, 拿掉loopback的設定
2.必須設定XSpi_SetSlaveSelect(不是XSpi_SetSlaveSelectReg)而且必須在初始化之後
MISO,意思是,如果是master mode,就當作input;如果是slave mode, 就當作output
1.須將所有相關code 加到src中 ,設定正確device id, 拿掉loopback的設定
2.必須設定XSpi_SetSlaveSelect(不是XSpi_SetSlaveSelectReg)而且必須在初始化之後
MISO,意思是,如果是master mode,就當作input;如果是slave mode, 就當作output
2012年9月7日 星期五
Xilinx 編譯指令:`define,`ifdef
//這樣的程式只會跑 c<=a+b 那一段,而不會跑c<=2,除非拿掉`define full
`define full
module top(
input rst,
input clk,
input [width-1:0] a,
input [width-1:0] b,
output reg [width:0] c
);
parameter width=1;
`ifdef full
always@(posedge clk or posedge rst)begin
if(rst)
c<=0;
else
c<=a+b;
end
`else
always@(posedge clk or posedge rst)begin
if(rst)
c<=0;
else
c<=2;
end
`endif
endmodule
`define full
module top(
input rst,
input clk,
input [width-1:0] a,
input [width-1:0] b,
output reg [width:0] c
);
parameter width=1;
`ifdef full
always@(posedge clk or posedge rst)begin
if(rst)
c<=0;
else
c<=a+b;
end
`else
always@(posedge clk or posedge rst)begin
if(rst)
c<=0;
else
c<=2;
end
`endif
endmodule
2012年9月4日 星期二
Xilinx Microblaze (2) -- 加入EDK 內部IP
若想在現有的XPS中新增 EDK IP,首先透過XPS中的IP catalog 將所想要的IP拖曳到System Assembly View中,切換到Address 頁面重新generate address。
回到Port頁面,Port頁面可分成兩部分,External Ports以及其他port。
External Port,顧名思義是system對外I/O設置。
其他port則是AXI匯流排系統的設置,一般port會有兩個子項目,BUS_IF 和IO_IF。
BUS_IF通常AXI(若是採AXI匯流排架構),而IO_IF就依照該IP所需要做設定,會有input or output or inout or tri-state 看是要連到外部(Make External)或只是新的接線(New Connection)或是接地(net_gnd)pull-high(net-vcc)等等。
注意!若是自己拖曳EDK IP需在完成XPS後,自行在verilog/VHDL加入訊號(腳位)宣告
回到Port頁面,Port頁面可分成兩部分,External Ports以及其他port。
External Port,顧名思義是system對外I/O設置。
其他port則是AXI匯流排系統的設置,一般port會有兩個子項目,BUS_IF 和IO_IF。
BUS_IF通常AXI(若是採AXI匯流排架構),而IO_IF就依照該IP所需要做設定,會有input or output or inout or tri-state 看是要連到外部(Make External)或只是新的接線(New Connection)或是接地(net_gnd)pull-high(net-vcc)等等。
注意!若是自己拖曳EDK IP需在完成XPS後,自行在verilog/VHDL加入訊號(腳位)宣告
訂閱:
文章 (Atom)