AN 826: インテル® Stratix® 10 GX FPGA開発ボードに向けた階層的なパーシャル・リコンフィグレーションのチュートリアル

ID 683327
日付 9/24/2018
Public
ドキュメント目次

手順 2: 子レベルのサブモジュールを作成する

このフラットデザインを階層的PRデザインに変換するには、親サブモジュール (blinking_led.sv) 内にネスト化される子サブモジュール (blinking_led_child.sv) を作成する必要があります。
  1. 新しいデザインファイルblinking_led_child.svを作成し、このファイルに次のコード行を追加します。
    `timescale 1 ps / 1 ps
    `default_nettype none
    
    module blinking_led_child (
    
       // clock
       input wire clock,
       input wire [31:0] counter,
    
    
       // Control signals for the LEDs
       output wire led_three_on
    
    );
       localparam COUNTER_TAP = 23;
       reg led_three_on_r;
    
    
       assign led_three_on   = led_three_on_r;
       
       always_ff @(posedge clock) begin
          led_three_on_r   <= counter[COUNTER_TAP];
       end
    
    endmodule
    
  2. blinking_led.svファイルを修正して、led_two_onをカウンターのビット23に静的領域から接続し、blinking_led_childモジュールをインスタンス化します。修正後のblinking_led.svファイルは、次のように表示されます。
    `timescale 1 ps / 1 ps
    `default_nettype none
    
    module blinking_led(
       // clock
       input wire clock,
       input wire [31:0] counter,
       // Control signals for the LEDs
       output wire led_two_on,
       output wire led_three_on
    );
    
    
       localparam COUNTER_TAP = 23;
    
       reg led_two_on_r;
       assign  led_two_on    = led_two_on_r;
       
       // The counter:
       always_ff @(posedge clock) begin
             led_two_on_r <= counter[COUNTER_TAP];
       end
    
    
       blinking_led_child u_blinking_led_child (
             .led_three_on           (led_three_on),
             .counter                (counter),
             .clock                  (clock)
       );
    
    endmodule
    
  3. すべてのデザインファイルを変更するには、Processing > Start > Start Analysis & Synthesisを実行します。