約 5,351,883 件
https://w.atwiki.jp/systemc/pages/16.html
SystemCのコンパイルを試す。 下記の記述がhello.cppにあるとすれば、 #include systemc using namespace sc_core; using namespace sc_dt; using namespace std; int sc_main(int argc, char **argv){ cout "Hello" endl; return 0; } g++ -o hello.x hello.cpp -I/usr/local/systemc-2.2/include -L/usr/local/systemc-2.2/lib-linux -lsystemc のようにコンパイルすることで、実行ファイルhello.xを作成することができる。/usr/local/systemc-2.2の部分は、SystemCをインストールしたディレクトリを記述する。lib-linuxの記述は、OSに合わせて変更する。 無事エラーなく作成できたら ./hello.xで実行しよう。 Hello と表示される。 SystemCのライブラリを使用するときに読み込むヘッダファイルは、systemcである。名前空間はsc_coreとsc_dtの2つが用意されている。dtは、data typeの略と思われ、sc_intなどのSystemCのデータ型が定義されている。SystemCのライブラリ中でmain()文が定義されているので、SystemCの記述はそのmain()文から呼び出されるsc_main()が最上位の記述となる。
https://w.atwiki.jp/systemc/pages/12.html
SystemC-2.3.1のインストール Accelleraのホームページからダウンロードする。特に修正しなくてもg++-4.9でコンパイル可能。修正以外の手順は2.2.0と同じ。 cygwin用は、configureするときに --enable-pthreadsのオプションが必要。 g++-4でのSystemC-2.2.0のインストール g++-4.9でコンパイルしようとするとエラーになる。エラー箇所(src/sysc/datatypes/bit/sc_bit_proxies.h)のmutableを消すとコンパイル可能ではあるが、他のバグもあるようなので、SystemC-2.3.1を使用するのがお勧め。 (ここから、2012年の記述) OSCIのホームページからダウンロードしてきたsystemc-2.2.0.tgzを展開する。 tar xvfz systemc-2.2.0.tgz 展開されたsystemc-2.2.0ディレクトリへ移動する。 cd systemc-2.2.0 src/sysc/utils/sc_utils_ids.cppの62行目に次の2行を加える。 #include cstdlib #include cstring src/sysc/kernel/sc_constants.hの中のSC_DEFAULT_STACK_SIZEは大きくした方が良い。0x50000くらいがお勧め。 作業用のobjdirディレクトリを作成する。 mkdir objdir objdirディレクトリへ移動する。 cd objdir CXX環境変数を設定した方が良いかもしれない。 export CXX=g++ コンパイル環境を構築する。 ../configure もし、環境を指定したい場合は、 ../configure --help で確認する。次のようにインストール場所を指定する場合が多い。 ../configure --prefix=/usr/local/systemc-2.2 インストール場所は、あらかじめ作成しておくこと。 コンパイルを行う。 make ライブラリなどをインストールする。 make install 2015-05-06 20 39 52 (Wed) -
https://w.atwiki.jp/systemc/pages/20.html
SystemC-AMSの紹介 SystemC-AMSは、Embedded Analog/Mixed-Signal(E-AMS) systemを取り扱う。デジタルの領域を扱うSystemCにアナログの領域を扱う手段を追加している。次のような目的で使われることを想定している。 実行可能仕様書 (Executable specification) 仮想試作 (Virtual prototyping) アーキテクチャ探索 (Architecture exploration) 実装検証 (Integration validation) SystemC-AMSのアナログシステムのモデル化の方法には次の3通りが用意されている。 Timed Data Flow (TDF) 離散時間の非線形な表現が可能。時間軸と周波数軸の処理を別々に定義する。 Linear Signal Flow (LSF) 連続時間の線形な数式を扱う。 Electrical Linear Network (ELN) 線形なふるまいをする部品(抵抗、コンデンサ、コイルなど)で回路を表現する。 TDFのモジュールはユーザが定義するが、LSFとELNでは用意されたモジュールを利用する前提になっている。これらのモジュールを含む上位階層はsc_moduleである。時間軸解析と小信号(周波数)解析を行うことができる。SPICEのような非線形解析はできない。 SystemC-AMS名前空間 TDFのモジュール LSFのモジュール ELNのモジュール 小信号(周波数)解析 時間軸解析 2012-02-15 18 47 06 (Wed) -
https://w.atwiki.jp/systemc/pages/27.html
高位合成 高位合成の定義は、学会でも業界でもきちんと定まっていないように思える。ここでは、高位合成(High Level Synthesis)は、RTL(Register Transfer Level)からの論理合成よりも抽象度の高い記述から自動的に論理回路を生成することと定義する。 入力がC言語などのプログラム言語であっても、HDL(Hardware Discription Language)で表現できるような内容のものしか受け付けないものが高位合成として市販されている場合もあるので、ユーザとしてはツールの機能をしっかり確認する必要がある。 動作合成 また、高位合成と同様な場面で使われる動作合成(Behavioral Synthesis)を、データパスに対するスケジューリングとリソースシェアリング(複雑な演算を時分割して演算器とレジスタを共用する)を自動生成する機能と定義する。 SystemCの高位合成ツールに望まれる機能 SystemCを用いた高位合成には、下記の機能が望まれる。 動作合成 インタフェース合成 関数型かオブジェクト指向による表現の抽象化 並列処理、処理タイミング、モジュール化、外部端子を表現する手段 高位の記述とは データパスの記述であれば、スケジューリングとリソースシェアリングを行う前の動作合成される記述が高位合成用の記述と考えられる。高位合成の価値はそれだけではないので、データパスのない制御系の記述で考えてみる。 汎用性の高い記述 動作の目的を明確にする。具体的な実装については、別の場所で定義する。 信号で進めと合図する。 signal.show(sign_go); 具体的な記述 動作を表現する。しかし、これでもまだ具体的な実装については、別の場所で定義する。 信号を青にする。 signal.set(color_blue); 詳細な記述 実装をそのまま記述する。ここまで記述するのであれば、高位合成は必要ない。 信号の青色灯を点灯する。黄色灯と赤色灯を消す。 signal.blue = true; signal.yellow = false; signal.red = false; 参考 動作合成 http //techon.nikkeibp.co.jp/article/WORD/20090107/163727/ SystemC推奨設計メソドロジ 合成編 http //jeita-edatc.com/users_lib/SystemC_DM_for_synthesis_080428.pdf SystemC Synthesizable Subset 1.3 draft Synthesis Working Group of Open SystemC Initiative 2014-02-11 13 14 07 (Tue) -
https://w.atwiki.jp/darwinia_jp/pages/50.html
マップ"Receiver"のメッセージです。 間違いや疑問点がありましたらBBSをご利用ください。 行 項目 原文 訳文 半角文 1235 receiver_objective1 Collect 50 Souls per minute 毎分50個の魂を集める マイフン 50コ ノ タマシイ ヲ アツメル 1236 receiver_objective2 Enable Biosphere Trunk Port Biosphereへのトランクポートを開く Biosphere ヘ ノ トランクポート ヲ ヒラク 1237 1238 receiver_primary_1 Each of those collectors requires Darwinians at its base to operate, which means you ll have to clear out the viral infection first. コレクターを操作するにはダーウィニアンの手が必要だ。まず、まわりにいるウィルスを駆除するんだ。 コレクター ヲ ソウサ スルニハ ダーウィニアン ノ テ ガ ヒツヨウダ。 マズ、 マワリ ニ イル ウィルス ヲ クジョ スルンダ。 1239 receiver_primary_2 The grid then transports those Unprocessed Souls here. This building brings together all the Unprocessed Souls from the grid and feeds them down a single line. そして、魂はここへ運ばれてくる。魂はこの建物に集められてから、まとめて送り出されるんだ。 ソシテ、 タマシイ ハ ココ ヘ ハコバレテ クル。 タマシイ ハ コノ タテモノ ニ アツメラレテ カラ、 マトメテ オクリ ダサレルンダ。 1240 receiver_primary_3 We will need to achieve a throughput of at least 50 Unprocessed Souls a minute to stand a chance of rebuilding the bulk of the Darwinian population. ダーウィニアンの人口を回復させるには、少なくとも毎秒50個の魂を送り出さなければならない。 ダーウィニアン ノ ジンコウ ヲ カイフク サセルニハ、 スクナクトモ マイフン 50コ ノ タマシイ ヲ オクリダサナケレバ ナラナイ。 1241 receiver_primary_4 Those Unprocessed Souls are then transported to the Biosphere, where they are processed and birthed into new Darwinians. Biosphereへ魂を送って、新しいダーウィニアンを誕生させるんだ。 Biosphere ヘ タマシイ ヲ オクッテ、 アタラシイ ダーウィニアン ヲ タンジョウ サセルンダ。 1242 1243 receiver_trunk_1 Once the Souls have been collected by the Spirit Receivers, they need to be transported to Darwinia s primary Biosphere. 受け取った魂は、Biosphereへ送って新しいダーウィニアンに生まれ変わらせるんだ。 ウケトッタ タマシイ ハ、 Biosphere ヘ オクッテ アタラシイ ダーウィニアン ニ ウマレカワラセルンダ。 1244 receiver_trunk_2 There they will be processed and birthed into new Darwinians. Open this Trunk Port to allow the Souls to be transmitted. このトランクポートを開けば魂を送れるようになるぞ。 コノ トランクポート ヲ ヒラケバ タマシイ ヲ オクレル ヨウニ ナルゾ。
https://w.atwiki.jp/systemc/pages/21.html
SystemC-AMSライブラリのキーワードはsca_で始まる。マクロはSCA_で始まる。 AMSの基本的なクラスは名前空間sca_coreにある。 トレースやデータ型のようなユーティリティクラスは名前空間sca_utilにある。 モデル化の手法ごとに名前空間(namespace)が用意されている。 モデル化の手法 名前空間 TDF sca_tdf LSF sca_lsf ELN sca_eln モデル化手法にかかわらず同等なクラスがある場合は、名前空間で区別される。 たとえば、TDF用のモジュールのクラスはsca_tdf sca_moduleである。 2012-01-30 21 04 15 (Mon)
https://w.atwiki.jp/wiihack/pages/26.html
インストール方法 Twilight Hackを用いて実行してください(他の方法では正常にインストールされない場合があります) 表示された文章に従ってください The Homebrew Channel Installer, version beta 8 (c) 2008 Team Twiizers Throughout this installer, you may ACCEPT prompts by pressing either the RESET button on your Wii, the START button on the first GameCube pad, or the 1 button on the first Wii Remote. To CANCEL at any prompt and return to the System Menu, pres the POWER button on your Wii, the Z button on the GameCube pad, or the HOME button on the Wii Remote. Pres ACCEPT to continue or CANCEL to exit to the Sytem Menu. The Homebrew Channel Installer, version beta 8 (c) 2008 Team Twiizers No proprietary Nintendo material (code or references) wad used to create this channel and its compronents. The source code, audiovisual resources, and the tools used to create and package the channel are all homebrew software. This product is not licensed or endorsed by Nintendo. DISCLAIMER THIS PRODUCT COMES WITH ABSOLUTELY NO WARRANTY, NEITHER EXPRESS NOR IMPLIED. THE AUTHORS OF THE PROGRAM CANNOT BE HELD RESPONSIBLE FOR ANY DAMAGE OCCURRING AS A RESULT OF ITS USE, INCLUDING BUT NOT LIMITED TO ANY HARDWARE OR SOFTWARE MALFUNCTION OF YOUR WII CONSOLE OR ANY OTHER DAMAGE CAUSED BY THE USE OF THE SOFTWARE. Please visit http //hbc.hackmii.com for more infomation. If you agreee to the above, press ACCEPT. Otherwise, press CANCEL to exit to the System Menu. The Homebrew Channel Installer, version beta 8 (c) 2008 Team Twiizers Loding installation data... Title ID 0001000148415858 Checking system... Ready to install. Press ACCEPT to continue or CANCEL to abort. The Homebrew Channel Installer, version beta 8 (c) 2008 Team Twiizers Loding installation data... Title ID 0001000148415858 Checking system... Ready to install. Press ACCEPT to continue or CANCEL to abort. Starting installation... User already has 1 tickets. Deleting them. Deleted ticket... Installing ticket... Adding title... Adding content ID 00000000 (cfd 0) ........................................ Done (0x9bdb0 bytes) Adding content ID 00000001 (cfd 0) ........................................ Done (0xb4b80 bytes) Installation complete! Pres ACCEPT or CANCEL to exit to the Wii System Menu. Returning to the Wii System Menu... フォルダ構成 apps/*/boot.elf 実行ファイルです apps/*/icon.png 表示されるアイコンです 128x48のサイズで用意してください apps/*/meta.xml ツールの詳細を記述するファイルです ?xml version="1.0" encoding="UTF-8" standalone="yes"? app version="1" name ツール名 /name coder 作者 /coder version バージョン /version release_date リリース日時 /release_date short_description ツールの簡易詳細 /short_description long_description ツールの詳細 /long_description /app アンイストール方法 システムメニューから削除してください 中指カーソル 以前にHomebrew Channelのnolomit版をインストールしているとこのようなカーソルが表示されます 一度Homebrew Channelのnolimit版をwad化したものをWAD Uninstallerを用いてアンインストールすることで解決します 注意事項 SDアダプタははずしておく事 README.txtにも書かれているようにSDGecko等のSDアダプタははずしておきましょう フロントSDからファイルを読み込めず起動しても何も表示されません The Homebrew Channel Beta 8 Wiibrew.org 2008/06/06 In this archive, you will find the following files README.txtThis file boot.elfMain channel installer wiiload/USBGecko / TCP loader client wiiload/win32/wiiload.exePrecompiled binary for Windows wiiload/lin32/wiiloadPrecompiled binary for Linux (x86) wiiload/osx/wiiloadPrecompiled binary for Mac OS X (Universal) wiiload/wiiload.tgzSource code Update instructions If you have previously installed The Homebrew Channel, you can update it. If this is the first time you are installing it, see below for Installation Instructions. The easiest way to update is using the built-in Online Update functionality. Simply configure the WiFi network settings for your Wii for proper Internet connectivity,and boot up the channel. If the connection is established, you ll see an opaque white (not semitransparent) world icon in the lower right corner, and an update prompt will automatically appear. Accept it to begin downloading the update. If you cannot or do not want to connect your Wii to the Internet, simply run the boot.elf file using any homebrew booting method. For example, you can upload it using wiiload or you can make a directory inside /apps (for example, /apps/Update) and copy boot.elf there. Then, simply run it from the previous version of the channel. Installation instructions The suggested way to install the Homebrew Channel is by using Zelda The Twilight Pricess with the Twilight Hack, which is available at http //wiibrew.org/index.php?title=Twilight_Hack. After installing the Twilight Hack savegame, format an SD card (as FAT16; must be =2GB, non-SDHC) and place the contents of this distribution in the root directory of that card. Boot.elf must be in the root directory, and you must have a directory named "apps" inside the root directory. (You can delete the wiiload files from the SD card, as they are not needed.) Execute the Twilight Hack, and it will load and run boot.elf from the SD card. You will be presented with a disclaimer screen about the dangers of installing this hack (discussed here as well, below); follow the instructions. After this process has completed, you should have a new Homebrew Channel in your System Menu. You may safely delete the boot.elf file from the SD card; it is no longer needed. Adding and customizing apps All user applications should be stored in their own subdirectory inside of apps/; some examples have been provided. Each subdirectory should have at least three files; ScummVM will be used as an example. apps/ScummVM/boot.[dol|elf] main executable to be loaded apps/ScummVM/icon.png icon to be displayed in the Homebrew Channel Menu; should be 128 x 48 apps/ScummVM/meta.xml XML description of the channel. This format will change for future releases of the Homebrew channel, but we will try to remain backwards-compatible. See the included files for information on what data should be included in this file. Staying current with new releases Relax, you will not need to do anything to keep up with new releases of the Homebrew Channel. When a new version is available, a message will appear giving you the option to download and install the new version, if your Wii is configured to connect to the Internet. Uninstallation You may uninstall the channel as you would any other channel, by using the Data Management screen of the Wii Menu. RISKS, CAUTIONS, and SYSTEM UPDATES Any persistent modification to your system (meaning, anything that does not go away when you turn off your Wii) carries some inherent risk. We have worked hard to avoid this whereever possible, but we are unable to test all possible configurations. We do, however, believe that our channel is safer to install than any other homebrew channel that has been released, and once you have installed it we hope you will never need to install another! A special note about System Updates The Homebrew Channel relies on certain security flaws (fakesigned TMD and ticket) that may eventually be fixed in future versions of the Wii System Software. When these flaws are fixed, you may not be able to install this channel for the first time. It is not clear what will happen to users who have already installed this channel. We have done extensive simulation testing with the current System Menu and the (currently dormant) IOS37, and we believe there is no danger to your system, even if you upgrade. That having been said, we are releasing this software to you in the hope that you will find it useful. We can not and will not offer you any warranty on the functionality of this software, or its impact on your Wii System. We have made our best effort to ensure its safety and to honestly explain the risks involved, but the decision (and responsibility) is ultimately up to you. We recommend that you check for news at http //wiibrew.org about com patibility with new Nintendo System Updates before installing them; we will test each update as soon as it is publicly available, and will announce whether any issues have been discovered.
https://w.atwiki.jp/bambooflow/pages/53.html
SystemC なんとなく覚書き。 勉強のためにメモを残しているだけなので、間違いやテキトウな表現が大いにあります。賢いひとは参考にしないでください。 願わくばSystemCがもっと普及することを。 SystemCを始めるSystemCとは インストール(Linux,Cygwin,VC++EE) HelloWorld - 始めの一歩 Makefileの書き方 クロックカウンタを作る - モジュール定義を覚える 並列処理について - 並列処理動作を体感する Visual C++2008 Express Editionでの使用方法について SystemCの基本的な機能SystemCの基本データタイプ固定小数点 ユーザデータタイプ モジュール プロセス動的プロセスについて チャネルsc_clockクロック信号 sc_fifoチャネル 未分類検証環境モデル構成(テンプレート) SystemCのコアとなるクラス定義一覧 エラボレーション・フェーズ RTL記述 デバッグ 遅延モデル サンプル ビットアクセス 検証波形トレース レポート処理について SCV ↓まだまだ、勉強不足でわからないことだらけ。 間違いもあると思うので注意のほど。 TLM-2.0TLM-2.0について TLM-2.0クラス ジェネリック・ペイロード b_transportについて ブロッキング・インターフェースLTモデル Interconnect(ブロッキングI/F LTモデル) その他SystemC関連の歴史 コーディングスタイル(自分用) 用語集 参考ページ SystemCDoxygenマニュアル 関連サーチ Doxygenマニュアル 参考のためDoxygenを使ってみた。なかなか便利かも。 SystemC ver 2.1.v1 SystemC ver 2.2 TLM-1.0 TLM-2.0 Draft2 TLM-2.0 SCV-1.0p2 注意 packageとqtのフォルダは含めていない。 関連サーチ #bf
https://w.atwiki.jp/bambooflow/pages/144.html
コアとなる言語クラス定義 コアとなる言語クラス定義ヘッダファイル コアクラス一覧 用意されたチャネルクラス定義チャネルクラス一覧 チャネル接続の対応表 ヘッダファイル SystemCを使うには次のヘッダファイルをインクルードする。 #include "systemc.h" #include "systemc.h" #include "systemc" #include "systemc" using sc_core sc_module; using sc_core sc_signal; using sc_core SC_NS; using sc_core sc_start; using sc_dt sc_logic; #include iostream using std ofstream; using std cout; using std endl; コアクラス一覧 sc_module sc_module_name sc_sensitive sc_spawn_optionsとsc_spawn sc_process_handle sc_event_finderとsc_event_finder_t sc_event_and_listとsc_event_or_list sc_evnet sc_time sc_port sc_export sc_interface sc_prim_channel sc_object sc_attr_base sc_attribute sc_attr_cltn 用意されたチャネルクラス定義 チャネルクラス一覧 sc_signal_in_if sc_signal_in_if<bool>とsc_signal_in_if<sc_dt sc_logic> sc_signal_inout_if sc_signal sc_signal<bool>とsc_signal<sc_dt sc_logic> sc_buffer sc_clock sc_in sc_in<bool>とsc_in<sc_dt logic> sc_inout sc_inout<bool>とsc_inout<sc_dt sc_logic> sc_out sc_signal_resolved sc_in_resolved sc_sc_inout_resolved sc_out_resolved sc_signal_rv sc_in_rv sc_inout_rv sc_out_rv sc_fifo_in_if sc_fifo_out_if sc_fifo sc_fifo_in sc_fifo_out sc_mutex_if sc_mutex sc_semaphore_if sc_semaphore sc_event_queue チャネル接続の対応表 入力 チャネル 出力 sc_port sc_signal_in_if X sc_signal X sc_buffer X sc_port sc_signal_out_if X sc_port sc_signal_inout_if X sc_port sc_signal_inout_if X sc_in X sc_out X sc_inout X sc_inout X sc_in bool sc_clock sc_in_resolved sc_signal_resolved sc_out_resolved sc_inout_resolved sc_inout_resolved sc_in_rv W sc_signal_rv W sc_out_rv W sc_inout_rv W sc_inout_rv W sc_port sc_fifo_in_if X sc_fifo X sc_port sc_fifo_out_if X sc_fifo_in X sc_fifo_out X X 型(bool,unsigned char,int,sc_uint , sc_int , etc.) W ビット幅 アクセス チャネル sc_port sc_mutex_if sc_mutex sc_port sc_semaphore_if sc_semaphore
https://w.atwiki.jp/bambooflow/pages/119.html
チャネル チャネルチャネルとは プリミティブチャネルsc_prim_channelについて 用意されているプリミティブチャネル一覧 チャネルとポートの接続対応表 sc_signalとsc_bufferの違いは? sc_clockは何チャネル? 階層チャネルsc_channelについて まとめ チャネルとは SystemCは、モジュール間の信号通信に"チャネル"という概念を提供して接続する機構を持たせている。 チャネルとモジュール間は、インターフェースとポートを介して接続する。 チャネルはインターフェースを実装(継承)する。モジュール側がそのインターフェースを持ったポートによりチャネルにアクセスすることができる。 Verilogだとwireで信号を接続するが、チャネルはwireのように単純な接続から内部に調停するような機構を持たせた複雑なものも表現できる。 チャネルはSystemCライブラリにいくつか用意されているが、ユーザが各自設計することができる。 チャネルには大きく分けて2種類ある。 プリミティブチャネル(primitive channel) 階層チャネル(hierarchical channel) プリミティブチャネルと階層チャネルの違いは、チャネル内にプロセスを持っているか持っていないかである。 プロセスを持っていないチャネルが、プリミティブチャネルで、 プロセスを持っているチャネルが、階層チャネルである。 プリミティブチャネル sc_prim_channelについて プリミティブチャネルはsc_prim_channelを継承している。 ユーザがプリミティブチャネルを作ることはまずない。 用意されているプリミティブチャネル一覧 sc_signal<type> 信号(プロセス間、子モジュール間との通信用) sc_buffer<type> sc_signalと同じ、値の書き込み時必ずイベント発生 sc_fifo<type> FIFOバッファつき入出力チャネル(使い方) sc_signal_resolved 1ビット幅の解決済み信号 sc_signal_rv<W> ビット幅Wをもつ解決済み信号 sc_semaphore 排他制御チャネル sc_mutex チャネルとポートの接続対応表 チャネルとポートの接続対応は次のとおり。 入力側 チャネル 出力側 sc_port sc_signal_in_if X sc_signal X sc_buffer X sc_port sc_signal_out_if X sc_port sc_signal_inout_if X sc_port sc_signal_inout_if X sc_in X sc_out X sc_inout X sc_inout X sc_in bool sc_clock sc_in_resolved sc_signal_resolved sc_out_resolved sc_inout_resolved sc_inout_resolved sc_in_rv W sc_signal_rv W sc_out_rv W sc_inout_rv W sc_inout_rv W sc_port sc_fifo_in_if X sc_fifo X sc_port sc_fifo_out_if X sc_fifo_in X sc_fifo_out X X 型(bool,unsigned char,int,sc_uint , sc_int , etc.) W ビット幅(int型) アクセス側 チャネル sc_port sc_mutex_if sc_mutex sc_port sc_semaphore_if sc_semaphore sc_signalとsc_bufferの違いは? sc_signalとsc_bufferの違いは、値が変化する/しないに関係なく書き込み時に毎回イベントが発生するか/しないかである。 値が変化したときのみイベントが発生するのは、sc_signal 値を書き込み時毎回イベントが発生するのは、sc_buffer 例 sc_signal int sig_data; sc_buffer int buf_data; //初期値はどちらも"0"とする。 for (int i=0; i 10; i++) { sig_data.write( 1 ); // sc_signalに10回"1"を書き込む buf_data.write( 1 ); // sc_bufferに10回"1"を書き込む } //////////////////////////////////////// sc_in int sig_data; sc_in int buf_data; int cntr1; int cntr2; SC_CTOR( MOD ) cntr1(0), cntr2(0) // カウンタの初期値を"0"にする { SC_METHOD( proc1 ); sensitive sig_data; // sc_signal SC_METHOD( proc2 ); sensitive buf_data; // sc_buffer } void proc1() { ++cntr1; printf( "cntr1 = %d\n", cntr1 ); // sc_signal } void proc2() { ++cntr2; printf( "cntr2 = %d\n", cntr2 ); // sc_buffer } 2つの信号(sig_data, buf_data)に毎回"1"を書き込んだとき、 sc_signalははじめの書き込み時の1回だけイベントが発生する。 sc_bufferは毎回の書き込み時、イベントが発生する。 したがって、cntr1の値は最後は"1"となり、cntr2の値は"10"となる。 sc_bufferはsc_signalを継承している。したがって、扱い方はほぼ同じといってよい。 ただし、2つのチャネルを併用したモデルは混乱するもとなので、片方のチャネルに統一して使ったほうがよい。 ただ、実際の設計では理想的にいかないかもしれないが。 sc_clockは何チャネル? sc_clockはどうなのだろう? sc_signal bool 型を継承しているので、一応sc_prim_channelを継承していることになるのでプリミティブ?でも、クロックを供給しているから、やっぱり階層チャネルの分類になるんだろうか? ポート、階層、SC_METHOD、SC_THREAD等はないので、やはりプリミティブとみてよいのかも。 階層チャネル たとえば、バスプロトコルを設計するときに、複数のターゲッタを調停するためのアービタを設けたりする。そういったときに、チャネルにプロセスを持たせてアービタを実装する方法がある。 このとき、プロセスを持つチャネルのことを階層チャネルと呼ぶ。 階層チャネルはSystemCライブラリでは提供されていない?ので、ユーザが各自で設計することになる。 チャネルのクラスを定義するには sc_channel を継承する。 sc_channelについて チャネルはsc_channelを継承する。 sc_channelはsc_module.hの544行目に以下のように記述されている。 typedef sc_module sc_channel; つまり、「sc_module = sc_channel」であるためチャネルはモジュールと同じ扱いができる。 違いは、モジュールは自らが動作する。 それに対してチャネルはモジュールからのアクセスを受けることで動作する。 チャンネルはインタフェースを実装する。 まとめ チャネルを理解するためには次の内容が区別できているかが重要になる。 チャネル インターフェース ポート ここでは、インタフェースとポートにはほとんど触れなかったが。。。