猪狩/IPIF-DMA Controller
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[猪狩/研究]]
*IPIF-DMA Controller(IPIF-DMAC)について [#zc2e82c5]
Xilinxが用意したDMA Controllerは同一マスターポートにてリード及びライトをおこなっているために、転送速度があまり速くない。&br;
そこで、ライト・マスターポートとリード・マスターポートを持つDAM Controllerを作成することにした。&br;
XPS(Xilinx Platform Studio)でシステム設計を行う際にベースとなるバスPLB(Processor Local Bus)の構造は複雑であるため、独自IPを実装する場合は、IPIFを用いる。&br;
本設計のIPIF-DMACもCIP(Create or Import)ウィザードでIPIFを含む独自IPを作成し、再度CIPウィザードで独自IPをインポートしたのち、システムに組み込んだ。&br;
&br;
IPIFを用いた独自IPの作成については、「EDK コンセプト、ツール、テクニック(UG683)」の第7章を参照のこと。&br;
IPIFを用いたシングル・バースト転送については、DS561, DS562, DS563, DS565を参照のこと。
**IPIF-DMACの設計 [#d668d0fc]
IPIF-DMACは「LogiCORE IP XPS Central DMA Controller (DS579)」をベースに設計を行った。&br;
DMA転送をテストするために作成したシステムの全体図及びIPIF-DMA Controllerのブロック図を下記に示す。&br;
CENTER:&ref(猪狩/IPIF-DMA Controller/ipifDMAint_multibus_sample3.png,80%);
CENTER:&ref(猪狩/IPIF-DMA Controller/ipifDMAcontroller.png,80%);
&br;&color(red,){※CIPウィザードでは、一つのスレーブポートとマスターポートしか設定できないため、CIPウィザードで2つの独自IPを作成し、デュアルマスターポートを持ったDMA Controllerを実現した。};
***CIP ウィザードを使用する場合の注意点 [#v9deec6c]
-CIPウィザードで独自IPを生成する場合
--Slaveインターフェイス
---何も付属せず生成
---Bus2IP_AddrポートをUser Logicへ接続するように設定
--Masterインターフェイス
---バースト転送をサポートするように生成
-生成した独自IPをXPSでシステムに組み込む場合
--IP Catalog -> Project Local PCores -> USER -> '''CustomIPName'''を左クリック、Add IPを選択
-CIPウィザードで生成した独自IPを変更する場合
--変更するファイル
---'''ProjectDirectory'''/ '''ProjectName'''/pcores/'''CustomIPName'''/hdl/vhdl/'''CustomIPName'''.vhd
---'''ProjectDirectory'''/ '''ProjectName'''/pcores/'''CustomIPName'''/hdl/verilog/user_logic.v
-独自IPをシミュレーションする場合
--User Logic部のみの変更
---Simulation -> Launch HDL Simulatorを選択
&br;(シミュレータの設定でISimを選択しておく。)
--独自IPに入出力を追加などを変更
---再度CIPウィザードでインポートする必要あり。
-CIPウィザードで独自IPをインポートする場合
--Name and Version
---クリエイトした際の名前とバージョン(1.00.a)に合わせる。
---上書きするか?と聞かれるので、Yesと答える。
--Source File Types
---HDL source files (*.vhd, *.vhdl, *.v, *,vh)を選択
--HDL Source Files
---HDL language used to implement your peripheral
&br;VerilogとVHDL両方使用した場合は、Mixedを選択
---How to locate your HDL source files and dependent library files
&br;prjファイルとpaoファイルはどちらもよい。
--Bus Interfaces
---Select bus interface(s)
&br;PLBV46 Master(MPLB), Generate burst, PLBV46 Slave(SPLB)を選択
--MPLB + SPLB : Port
---User Logicファイルのポート名を変更していなければ、自動認識するはず
--SPLB : Parameter
---C_BASEADDRとC_HIGHADDRに設定
--Identify Interrupt Signals
---割り込み線がある場合は選択
**IPIF-DMAC Register Descriptions [#se04a289]
|Register Name|Base Address + Offset (hex)|Access|
|Software Reset Register (RST)|C_BASEADDR + 0|Write|
|DMA Control Register (DMACR)|C_BASEADDR + 4|R/W|
|Source Address (SA)|C_BASEADDR + 8|R/W|
|Destination Address (DA)|C_BASEADDR + C|R/W|
|Length (LENGTH)|C_BASEADDR +10|R/W|
&color(red){※設計上、C_BASEADDRは"0x80000000"に固定して実装した。};
***Software Reset Register (RST) [#od2075c1]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|RST|Write|0|Software Reset& br;A write of 0x0000000A causes reset of the XPS Central DMA Controller. A write of any other value has undefined effect and returns a bus error. A read of this register returns zero.|
***DMA Control Register (DMACR) [#x6d93003]
|Bits|Name|Core Access|Reset Value|Description|
|0|SINC|R/W|'1'|Source Increment: Increment the source address by the number of source bytesread.&br;’1’ = Increment the source address.&br;’0’ = Do not increment the source address.&br;SINC = ’0’ is allowed if and only if the Source Address register is written with a keyhole address.|
|1|DINC|R/W|'0'|Destination Increment: Increment the destination address by the number of bytes written in to the destination.&br;’1’ = Increment the destination address.&br;’0’ = Do not increment the destination address.&br;DINC = ’0’ is allowed if and only if the Destination Address register is written with a keyhole address.|
|2-31||||Reserved|
***Source Address (SA) [#l1e3caa5]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|SA|Write|0|Source Address: Source address for the current DMA operation. When SINC = ’1’, as data is moved from the source address, this register updates to track the current source address. When SINC = ’0’, the source address remains constant at the programmed value. (See also the SINC field of the DMA Control Register).|
***Destination Address (DA) [#l1e3caa5]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|DA|Write|0|Destination Address: Destination address for the current DMA operation. When DINC = ’1’, as data is moved to the destination address, this register updates to track the current destination address. When DINC = ’0’, the destination address remains constant at the programmed value. (See also the DINC field of the DMA Control Register.)|
***Length (LENGTH) [#e6a59664]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|LENGTH|R/W|0|Length of the DMA Transfer : The DMA operation starts when the number of bytes to be transferred from source to destination is written to the Length Register. Therefore, this register is written only after the DMA Control register, the Source Address and the Destination Address registers have been written with their desired values and any other setup is complete. As bytes are successfully written to the destination, the Length Register decrements to reflect the number of bytes remaining to be transferred. The Length Register will be zero after a successful DMA operation.|
**スペック [#b53c51e8]
-バースト転送数:16
-内部FIFO数:32
-動作周波数:130MHz(1/7.692ns)
&br;&br;
&color(red,){※内部FIFO数と動作周波数は固定};
***転送速度 [#ebfbaf17]
-16個のデータを"x"回分転送したときの転送時間
33 + (2x-1)*16 = 32x + 17
|x|転送データ量(Byte)|クロック数(clk)|転送時間(ms)|
|1|64|49|0.377|
|2|128|81|0.623|
|4|256|145|1.115|
|8|512|273|2.100|
|16|1024|561|4.315|
終了行:
[[猪狩/研究]]
*IPIF-DMA Controller(IPIF-DMAC)について [#zc2e82c5]
Xilinxが用意したDMA Controllerは同一マスターポートにてリード及びライトをおこなっているために、転送速度があまり速くない。&br;
そこで、ライト・マスターポートとリード・マスターポートを持つDAM Controllerを作成することにした。&br;
XPS(Xilinx Platform Studio)でシステム設計を行う際にベースとなるバスPLB(Processor Local Bus)の構造は複雑であるため、独自IPを実装する場合は、IPIFを用いる。&br;
本設計のIPIF-DMACもCIP(Create or Import)ウィザードでIPIFを含む独自IPを作成し、再度CIPウィザードで独自IPをインポートしたのち、システムに組み込んだ。&br;
&br;
IPIFを用いた独自IPの作成については、「EDK コンセプト、ツール、テクニック(UG683)」の第7章を参照のこと。&br;
IPIFを用いたシングル・バースト転送については、DS561, DS562, DS563, DS565を参照のこと。
**IPIF-DMACの設計 [#d668d0fc]
IPIF-DMACは「LogiCORE IP XPS Central DMA Controller (DS579)」をベースに設計を行った。&br;
DMA転送をテストするために作成したシステムの全体図及びIPIF-DMA Controllerのブロック図を下記に示す。&br;
CENTER:&ref(猪狩/IPIF-DMA Controller/ipifDMAint_multibus_sample3.png,80%);
CENTER:&ref(猪狩/IPIF-DMA Controller/ipifDMAcontroller.png,80%);
&br;&color(red,){※CIPウィザードでは、一つのスレーブポートとマスターポートしか設定できないため、CIPウィザードで2つの独自IPを作成し、デュアルマスターポートを持ったDMA Controllerを実現した。};
***CIP ウィザードを使用する場合の注意点 [#v9deec6c]
-CIPウィザードで独自IPを生成する場合
--Slaveインターフェイス
---何も付属せず生成
---Bus2IP_AddrポートをUser Logicへ接続するように設定
--Masterインターフェイス
---バースト転送をサポートするように生成
-生成した独自IPをXPSでシステムに組み込む場合
--IP Catalog -> Project Local PCores -> USER -> '''CustomIPName'''を左クリック、Add IPを選択
-CIPウィザードで生成した独自IPを変更する場合
--変更するファイル
---'''ProjectDirectory'''/ '''ProjectName'''/pcores/'''CustomIPName'''/hdl/vhdl/'''CustomIPName'''.vhd
---'''ProjectDirectory'''/ '''ProjectName'''/pcores/'''CustomIPName'''/hdl/verilog/user_logic.v
-独自IPをシミュレーションする場合
--User Logic部のみの変更
---Simulation -> Launch HDL Simulatorを選択
&br;(シミュレータの設定でISimを選択しておく。)
--独自IPに入出力を追加などを変更
---再度CIPウィザードでインポートする必要あり。
-CIPウィザードで独自IPをインポートする場合
--Name and Version
---クリエイトした際の名前とバージョン(1.00.a)に合わせる。
---上書きするか?と聞かれるので、Yesと答える。
--Source File Types
---HDL source files (*.vhd, *.vhdl, *.v, *,vh)を選択
--HDL Source Files
---HDL language used to implement your peripheral
&br;VerilogとVHDL両方使用した場合は、Mixedを選択
---How to locate your HDL source files and dependent library files
&br;prjファイルとpaoファイルはどちらもよい。
--Bus Interfaces
---Select bus interface(s)
&br;PLBV46 Master(MPLB), Generate burst, PLBV46 Slave(SPLB)を選択
--MPLB + SPLB : Port
---User Logicファイルのポート名を変更していなければ、自動認識するはず
--SPLB : Parameter
---C_BASEADDRとC_HIGHADDRに設定
--Identify Interrupt Signals
---割り込み線がある場合は選択
**IPIF-DMAC Register Descriptions [#se04a289]
|Register Name|Base Address + Offset (hex)|Access|
|Software Reset Register (RST)|C_BASEADDR + 0|Write|
|DMA Control Register (DMACR)|C_BASEADDR + 4|R/W|
|Source Address (SA)|C_BASEADDR + 8|R/W|
|Destination Address (DA)|C_BASEADDR + C|R/W|
|Length (LENGTH)|C_BASEADDR +10|R/W|
&color(red){※設計上、C_BASEADDRは"0x80000000"に固定して実装した。};
***Software Reset Register (RST) [#od2075c1]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|RST|Write|0|Software Reset& br;A write of 0x0000000A causes reset of the XPS Central DMA Controller. A write of any other value has undefined effect and returns a bus error. A read of this register returns zero.|
***DMA Control Register (DMACR) [#x6d93003]
|Bits|Name|Core Access|Reset Value|Description|
|0|SINC|R/W|'1'|Source Increment: Increment the source address by the number of source bytesread.&br;’1’ = Increment the source address.&br;’0’ = Do not increment the source address.&br;SINC = ’0’ is allowed if and only if the Source Address register is written with a keyhole address.|
|1|DINC|R/W|'0'|Destination Increment: Increment the destination address by the number of bytes written in to the destination.&br;’1’ = Increment the destination address.&br;’0’ = Do not increment the destination address.&br;DINC = ’0’ is allowed if and only if the Destination Address register is written with a keyhole address.|
|2-31||||Reserved|
***Source Address (SA) [#l1e3caa5]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|SA|Write|0|Source Address: Source address for the current DMA operation. When SINC = ’1’, as data is moved from the source address, this register updates to track the current source address. When SINC = ’0’, the source address remains constant at the programmed value. (See also the SINC field of the DMA Control Register).|
***Destination Address (DA) [#l1e3caa5]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|DA|Write|0|Destination Address: Destination address for the current DMA operation. When DINC = ’1’, as data is moved to the destination address, this register updates to track the current destination address. When DINC = ’0’, the destination address remains constant at the programmed value. (See also the DINC field of the DMA Control Register.)|
***Length (LENGTH) [#e6a59664]
|Bits|Name|Core Access|Reset Value|Description|
|0-31|LENGTH|R/W|0|Length of the DMA Transfer : The DMA operation starts when the number of bytes to be transferred from source to destination is written to the Length Register. Therefore, this register is written only after the DMA Control register, the Source Address and the Destination Address registers have been written with their desired values and any other setup is complete. As bytes are successfully written to the destination, the Length Register decrements to reflect the number of bytes remaining to be transferred. The Length Register will be zero after a successful DMA operation.|
**スペック [#b53c51e8]
-バースト転送数:16
-内部FIFO数:32
-動作周波数:130MHz(1/7.692ns)
&br;&br;
&color(red,){※内部FIFO数と動作周波数は固定};
***転送速度 [#ebfbaf17]
-16個のデータを"x"回分転送したときの転送時間
33 + (2x-1)*16 = 32x + 17
|x|転送データ量(Byte)|クロック数(clk)|転送時間(ms)|
|1|64|49|0.377|
|2|128|81|0.623|
|4|256|145|1.115|
|8|512|273|2.100|
|16|1024|561|4.315|
ページ名: