LRM読解(Chap.11)

2008/11/28Verilog::文法import

11. 名前つきblockとtaskの無効化 ~ Disabling of named blocks and tasks 'disable'文は,Verilog HDLの手続き上の記述の構造化された本質を維持している間,併発してアクティブな手続きの実行(activity)を終了することに関する能力を与えます.

disable文は,taskの命令を全て実行する前に終了させることや,loop文からのbreakすることや,loop文のほかの反復とともに連続するため命令をスキップすること,のメカニズムを与えます.ハードウェア割込みやglobal resetのような例外状態をハンドリングするのに有用です.

disable_statement ::= (From Annex A - A.6.5)
    disable hierarchical_task_identifier ;
  | disable hierarchical_block_identifier ;

それぞれの様式のdisable文は,taskまたは名前付けされたブロックを終了します.処理は,blockに続く命令から,または,後のtask enabling文により再開します.また,名前つきblock内や,task内で有効になった,全ての活動(activities)は,終えられるものとします.

task enable文がネストしていて(1つのtaskがほかのtaskをenableにするような場合),一方が他方をまだenbaleにしていないならば,連鎖の中でtaskをdisableにすることは,下位の連鎖全てのtaskをdisableにすることである.

If task enable statements are nested that is, one task enables another,
 and that one enables yet another
  then disabling a task within the chain
   shall disable all tasks downward on the chain.

taskが1回以上enableにされるならば,そのようなtaskを無効にすることは,そのtaskの全ての起動が無効にされるものとします.(disableのqueingされたものが全て消える,という意味かしら??)

If a task is enabled more than once, then disabling such a task shall disable all activations of the task.

taskがdisableにされるなら,taskによって開始されるかもしれない以下の活動(activities)の結果は定義されません:

  • output引数とinout引数の結果
  • スケジューリングされたけれども実行されていないノンブロッキング代入
  • 手続き型連続代入(assign文とforce文)

disbale文は,disable文に含まれる,特殊なblockやtaskをdisableするのに,blockとtask内で使えます.disbale文は,function内の名前つきblockをdisableにすることができます.function内のdisable文があるところでは,blockかtaskをdisableにします.この挙動は未定義です.

automatic task中に,automatic taskまたはblockを無効化することは,タスクのすべての同時発生の実行のための通常のタスクのように続きます.(意味わからん)

Disabling an automatic task or a block inside an automatic task 
It proceeds as for regular tasks for all concurrent executions of the task.

例1) 本例は,blockが自身をdisableする方法を示します.

begin : block_name
  rega = regb;
  disable block_name;
  regc = rega; // この代入は実行されることはない.
end

例2) 本例は,disable文を,名前つきblockで,前方goto文と似たように使うことを示します(意訳).disable文の後の,次の命令文は,名前つきblockに続くものとなります.

begin : block_name
  ...
  ...
  if (a == 0)
    disable block_name;
  ...
end // 名前つきblockの終端
// 名前つきblockの後のコードから継続実行する
  ...

例3) この例は,taskからの早期returnのように使うdisable文を示します.しかし,diable文を使ってtask自身をdisableにすることは,プログラミング言語で見つけるようなreturn文のための速記(short-hand)ではありません.

task proc_a;
begin
  ...
  ...
  if (a == 0)
    disable proc_a; // trueであれば返る.
  ...
  ...
end
endtask

例4) この例は,C言語のcontinue/break文の2つと同じように使うdisable文を示します.例は,名前つきblockが,ループカウンタがnに達するまで繰り返すか,変数aがbの値にセットされるまで実行される,制御コードを示します.名前つきブロック"break"は,a==bになるまで実行するようなコードを含んでいます.このポイントでは,"disable break;"文が,blockの実行を終了します.名前つきブロック"continue"は,for loopのそれぞれの繰り返しを実行するコードを含んでいます.毎回,このコードは"disable continue;"命令をh実行し,"continue"blockを終了します.そして,次のfor loopの反復処理へ移ります.

"continue"blockの反復制御には,命令文セットは,a!=0であれば実行する.他の命令セットは,a!=bであれば実行する.(訳注:要はこの文だけ.)

begin : break
  for (i = 0; i < n; i = i+1) begin : continue
    @clk
      if (a == 0) // "continue" loop
        disable continue;
      <statements>
      <statements>
    @clk
      if (a == b) // "break" from loop
        disable break;
      <statements>
      <statements>
  end
end

例5) この例は,resetイベントが起きたときの,タイミング制御とtask"action"を同時実行を無効にするdisable文を示します.? being used to disable concurrently a sequence of timing controls and the task action, when the reset event occurs.

例は,"event_expr"と名づけられたシーケンシャルブロックと,イベント"reset"の発生を待つdisable文とから成るfork/join blockを示します.シーケンシャルブロックと,reset待ちとは,並行して実行します."event_expr"ブロックは,イベント"ev1"とイベント"trig"の三回の発生を待ちます.これら4つのイベントが生じて,さらに'd'時間単位経過したときに,task"action"が実行します.イベント"reset"がおきたとき,シーケンシャルブロック内のイベントにかかわらず,task"action"を含めて,fork/joinブロックは終了します.

fork
  begin : event_expr
    @ev1;
    repeat (3) @trig;
    #d action (areg, breg);
  end
  @reset disable event_expr;
join

例6) 次の例は,再トリガ可能な単安定のビヘイビア記述の例です.名前がつけられた"retrig"イベントは,単安定時間周期で再開します."retrig"が,250時間単位以内で起こり続けていると,Qは1となります.

always begin : monostable
  #250 q = 0;
end

always @retrig begin
  disable monostable;
  q = 1;
end


(個人的まとめ)
diable/continue文は,シミュレーションモデルで使うと効果的かもしれない.ハードウェア記述で使うのはナンセンスだろう.(合成できるかどうかも怪しいか. パラメータを使ってコンパイル時にのみインスタンスを複数生成することなんかには使えそう.)

[Altera][TSR] derive_pll_clocks

2008/11/24FPGA::QuartusIIimport

[Altera][TSR] derive_pll_clocks

Usage

derive_pll_clocks [-create_base_clocks] [-use_tan_name]

Options

-create_base_clocks
Creates base clocks on input clock ports of the design that are feeding the PLL
-use_tan_name
Use net names as clock names

Description

デザイン内のPLLか同様のリソースを特定し,そのクロック出力端子をgenerated clockとして生成します.複数のgenerated clockが,PLLがクロックスイッチ切り替えを使っているのであれば,各クロック出力端子毎に作られるでしょう.(1つは入力クロック端子inclk[0],一方はinclk[1]入力クロック端子).

デフォルトでは,このコマンドはPLLを駆動する入力クロックポートに基準クロック(base clock)を作りません.By default this command does not create base clocks on input clock ports that are driving the PLL. "create_base_clocks"オプションを使うとき,"derive_pll_clocks"もまたPLLを駆動する入力クロックポート上の基準クロックを作ります.When you use the create_base_clocks option, derive_pll_clocks also creates the base clock on an input clock port deriving the PLL.このオプションは既存のクロックを上書きしません.デフォルトでは,クロック名は出力クロック端子名と同じになります.ネット名を使う(同じ名前は,クラシックなTiming Analyzerが使います)ためには,"-use_tan_name"オプションを使用してください.


Example

project_open top
create_timing_netlist

# Create the base clock for the input clock port driving the PLL
create_clock -period 10.0 [get_ports sysclk]

# Create the generated clocks for the PLL.
derive_pll_clocks
update_timing_netlist

# Other user actions
report_timing
delete_timing_netlist
project_close


注意事項

英語力の弱い人が適当に訳しています.自分では意味がわかるようにとれたものと,そうでないものとがあります.概要理解の参考にしていただければ幸いですが,オリジナルの英文を参照されることを強く推奨いたします.

[Altera][TSR] get_pins

2008/11/24FPGA::QuartusIIimport

[Altera][TSR] get_pins

Usage

get_pins [-compatibility_mode] [-hierarchical] [-no_duplicates] [-nocase] [-nowarn] <filter>

Options

-compatibility_modeUse simple Tcl matching (Classic Timing Analyzer style)
-hierarchicalSpecifies use of a hierarchical searching method
-no_duplicatesDo not match duplicated pin names
-nocaseSpecifies case-insensitive node name matching
-nowarnDo not issue warnings messages about unmatched patterns
Valid destinations (string patterns are matched using Tcl string matching)


Description

デザイン内のピンのコレクションを返します.コレクション内の全てのピン名は,指定パターンとしてマッチします.ワイルドカードは,一度に複数のピンを選択するのに使えます.

このコマンドでは,以下の3つのTcl文字列マッチング方法があります.

  • デフォルトの方法
  • "-hierarchical"オプションを使う方法
  • "-compatibility_mode"オプションを使う方法

デフォルトでは,1階層レベルを分割するために,次から'|'が使われます.特殊文字として扱われ,ワイルドカードにあわせる文字列マッチング実行時に,考慮に入れられます.

デフォルトマッチングスキームが有効なとき,指定されたパターンは絶対ピン名(absolute pin names)(全体の階層パスを含んだ名前)に対してマッチングされます.

パターン内の全ての階層レベルはレベルごとにマッチングされます.書式"|"のピン名は,マッチングに使われます.全cell名(full cell name)は,階層を考慮するために,複数のパイプ文字'|'を含めることに注意してください.

どんな含まれたワイルドカードも,たった1階層レベルしか参照しません.例えば,"*|*"と"*|*|*"は,それぞれ最も高い階層レベルと2番目の階層レベルとを参照するので,異なるコレクションを提供します.


"-hierarchical"マッチングスキームを使うとき,パイプ文字'|'は,特殊文字として扱われ,文字列マッチングの実行時に適用されます.このマッチングスキームは,階層構造を通して強制的に再帰的にに実行します.
指定されたパターンは関係するピンに対してマッチングされる.(どんな階層構造情報も含まれない,直接名(immediate name))
様式"|"のピン名がマッチングに使われます."short cell name"は,パイプ文字('|')を含んではいけないことに注意してください.どのような含まれているワイルドカードも,関連するピン名にマッチするように拡張されます.
例えば,"*" と "*|*" は,前者が後者に拡張されるので,性格に同じピンにマッチします.


"-compatibility_mode"マッチングスキームは,全て,絶対的なピン名に対して(for full, absolute pin names.)Classic timing analyzerの文字列マッチング挙動を模擬します.

パイプ文字('|')は,ワイルドカードと使ったときに特殊文字として扱われません.デフォルトマッチングスキームは,ピンのみだけではなく,それらのピンから複製されたピンも返します.(前者のピンから,Quartusによって自動生成されるピンを参照ください(どこかにリンクしてるのかな))

複製されたピンを含めないようにするには,"-no_duplicates"オプションを使ってください.特定の型のコレクションを生成するのに使うwildcardのTcl list,または,TimeQuestextension置換規約が必要です.詳細は,"use_timequest_style_escaping"を参照ください.


Example

# Get regout pin of "reg" cell
get_pins -nocase reg|regout

# Create a collection of all pins of "reg" cell
get_pins reg|*

# Create a collection of all pins on the highest hierarachical level
set mycollection [get_pins *]

# Output pin names.
foreach_in_collection pin $mycollection {
  puts [get_pin_info -name $pin]
}

# Create a collection of all pins in the design
set fullcollection [get_pins -hierarchical *]

# Output pin IDs and names.
foreach_in_collection pin $fullcollection {
  puts -nonewline $pin
  puts -nonewline ": "
  puts [get_pin_info -name $pin]
}

注意事項

英語力の弱い人が適当に訳しています.自分では意味がわかるようにとれたものと,そうでないものとがあります.概要理解の参考にしていただければ幸いですが,オリジナルの英文を参照されることを強く推奨いたします.

[Altera][TSR] set_clock_groups

2008/11/24FPGA::QuartusIIimport

[Altera][TSR] set_clock_groups

Usage

set_clock_groups [-asynchronous] [-exclusive] -group <names>

Options

-asynchronous
Specify mutually exclusive clocks (same as the -exclusive option). Exists for compatibility.
-exclusive
Specify mutually exclusive clocks
-group
Valid destinations (string patterns are matched using Tcl string matching)

Description

"Clock groups"は,どのclockが関連しないかを指定するのに早くて便利な方法を提供します.Clock groups provide a quick and convenient way to specify which clocks are not related.

非同期clockは,完全に関係のないものです*1.(例えば,独立した異なるclock源を持つとき)

排他的なclock,同時にはactiveにならないものです*1.(例えば,multiplexされたclock)

TimeQuestは,まるでそれらが同じであるかのように,どちらのオプションも扱います("-exclusive" , "-asynchronous").

"set_clock_groups"の結果は,どんなgroup内の全てのclockも,他の各group内のclock全てから遮断(cut)されます.このコマンドは,全部のgroupの各clockから,他のgroupの各clockへ"set_false_path"を呼び出すのと等価です.clockドメインを切り離す指定を容易にするため,"set_clock_groups"を作りました(?).

単品の"-group"オプションを使うことは,TimeQuestに,"デザイン内のほかの全てのclockから,このgroupを切り離せ"と伝えます.


Example

project_open top
create_timing_netlist
create_clock -period 10.000 -name clkA [get_ports sysclk[0]]
create_clock -period 10.000 -name clkB [get_ports sysclk[1]]

# Set clkA and clkB to be mutually exclusive clocks.
set_clock_groups -exclusive -group {clkA} -group {clkB}

# The previous line is equivalent to the following two commands.
set_false_path -from [get_clocks clkA] -to [get_clocks clkB]
set_false_path -from [get_clocks clkB] -to [get_clocks clkA]

*1 : テキトウ.例文で把握されたし.

注意事項

英語力の弱い人が適当に訳しています.自分では意味がわかるようにとれたものと,そうでないものとがあります.概要理解の参考にしていただければ幸いですが,オリジナルの英文を参照されることを強く推奨いたします.

[Altera][Q2HB] HandBook

2008/11/24未分類import

[Altera][Q2HB] HandBook

コレを全部読めれば,設計フローからソフトの使い方から,おおよそ把握できるはず..(総ページ2496)
QuartusIIからヘルプを押下すると,このHandbook内の章や節が分冊されたものを開こうとするでしょう.vざっと何をすべきか,何ができるかを把握するには,こちらを見て脳内indexを生成しておくと効率が良いでしょう*1



*1 : 拙者,記憶の揮発性が高いので,結構時間の無駄になっている気もしますが....

QuartusII Handbook全貌

ファイル:"quartusii_handbook.pdf"

Quartus II Handbook Version 8.1
 Volume 1: Design and Synthesis
  Section I. Design Flows
   Chapter 1, Design Planning with the Quartus II Software
    重要なFPGAデザインの計画について記されます.
     - device selection
     - early power estimation
     - I/O pin planning
     - design planning
    要求事項とALTERAの各種ツールの紹介もあります.

   Chapter 2, Quartus II Incremental Compilation for Hierarchical and Team-Based Design
    無料ツールでサポートしてなさげなので省略.
    グループ開発をサポートするQuartusの使い方と思想について記述あり.

   Chapter 3, Quartus II Design Flow for MAX+PLUS II Users
    MAX+PLUS IIユーザ向けの乗り換え案内?

   Chapter 4, Quartus II Support for HardCopy Series Devices
    FPGAで試作,ASICで量産を行う際のフローについて解説?


  Section II. Design Guidelines
   Chapter 5, Design Recommendations for Altera Devices and the Quartus II Design Assistant
    同期設計の演習と組み合わせ回路の構造とクロックスキームのガイドラインを記す.
    Design Assistantを使ってデザインルールチェックをする方法を含みます.
    デバイスアーキテクチャのデザイン指標について考えるときに読むべき...?

   Chapter 6, Recommended HDL Coding Styles
    推奨HDL コーディングスタイルと例示(VHDL/VerilogHDL).
    ALTERAデバイスアーキ依存のオプション記述についても触れる模様..

   Chapter 7, Best Practices for Incremental Compilation Partitions and Floorplan Assignments
    インクリメンタルコンパイルとフロアプラン設計演習.
    グループデザインを行う場合に参照すればよい?.無償版では使えないだろう.

  Section III. Synthesis
   論理合成全般.
   Chapter 8, Quartus II Integrated Synthesis
   Chapter 9, Synopsys Synplify Support
   Chapter 10, Mentor Graphics Precision Synthesis Support
   Chapter 11, Mentor Graphics LeonardoSpectrum Support
   Chapter 12, Analyzing Designs with Quartus II Netlist Viewers


 Volume 2: Design Implementation and Optimization
  Section I. Scripting and Constraint Entry
   Chapter 1, Assignment Editor
   Chapter 2, Command-Line Scripting
   Chapter 3, Tcl Scripting
   Chapter 4, Managing Quartus II Projects

  Section II. I/O and PCB Tools
   Chapter 5, I/O Management
   Chapter 6, Mentor Graphics PCB Design Tools Support
   Chapter 7, Cadence PCB Design Tools Support

  Section III. Area, Timing and Power Optimization
   Chapter 8, Area and Timing Optimization
   Chapter 9, Power Optimization
   Chapter 10, Analyzing and Optimizing the Design Floorplan
   Chapter 11, Netlist Optimizations and Physical Synthesis
   Chapter 12, Design Space Explorer

  Section IV. Engineering Change Management
   Chapter 13, Engineering Change Management with the Chip Planner

 Volume 3: Verification
 Volume 4: SOPC Builder
  Section I. Simulation
   Chapter 1, Quartus II Simulator
   Chapter 2, Mentor Graphics ModelSimSupport
   Chapter 3, Synopsys VCS Support
   Chapter 4, Cadence NC-Sim Support
   Chapter 5, Aldec Active-HDL Support
   Chapter 6, Simulating Altera IP in Third-Party Simulation Tools

  Section II. Building Systems with SOPC Builder
   Chapter 9, SOPC Builder Memory Subsystem Development Walkthrough
   Chapter 10, SOPC Builder Component Development Walkthrough

  Section III. Interconnect Components
   Chapter 11, Avalon Memory-Mapped Bridges
   Chapter 12, Avalon Streaming Interconnect Components

 Volume 5: Embedded Peripherals
   Section I. Off-Chip Interface Peripherals
    Chapter 1, SDRAM Controller Core
    Chapter 2, CompactFlash Core
    Chapter 3, Common Flash Interface Controller Core
    Chapter 4, EPCS Device Controller Core
    Chapter 5, JTAG UART Core
    Chapter 6, UART Core
    Chapter 7, SPI Core
    Chapter 8, Optrex 16207 LCD Controller Core
    Chapter 9, PIO Core
    Chapter 10, Avalon-ST JTAG Interface Core
    Chapter 11, Avalon-ST Serial Peripheral Interface Core
    Chapter 12, SPI Slave/JTAG to Avalon Master Bridge Cores
    Chapter 13, PCI Lite Core

   Section II. On-Chip Storage Peripherals
    Chapter 14, Avalon-ST Single Clock and Dual Clock FIFO Cores
    Chapter 15, On-Chip FIFO Memory Core
    Chapter 16, Avalon-ST Multi-Channel Shared Memory FIFO Core

   Section III. Transport and Communication
    Chapter 17, Avalon Streaming Channel Multiplexer and Demultiplexer Cores
    Chapter 18, Avalon-ST Bytes to Packets and Packets to Bytes Converter Cores
    Chapter 19, Avalon Packets to Transactions Converter Core
    Chapter 20, Avalon-ST Round Robin Scheduler Core

   Section IV. Peripherals
    Chapter 21, Scatter-Gather DMA Controller Core
    Chapter 22, DMA Controller Core
    Chapter 23, Video Sync Generator and Pixel Converter Cores
    Chapter 24, Interval Timer Core
    Chapter 25, System ID Core
    Chapter 26, Mutex Core
    Chapter 27, Mailbox Core

   Section V. Test and Debug Peripherals
    Chapter 28, Cyclone III Remote Update Controller Core
    Chapter 29, Performance Counter Core
    Chapter 30, Avalon Streaming Test Pattern Generator and Checker Cores

後半抜けてますが,まぁわかるでしょう.
判るならコレ要らないか...('A`