2

私は、Scala が C++ の一種のマクロとして "@elidable" を使用していることをググりました。
ChiselHDL はデバッグ用にこのようなものもサポートしていますか?
または、他の代替手段はありますか?

scala コンテキストでは、

@elidable(WARNING) def debug(signal: Wire) = when(signal){ printf("Cache miss!") }
debug(miss)  // At every rising edge of clock, print whether there's cache miss or not.

Chisel にプリプロセッサと #ifdef ステートメントがあるとします。

#define DEBUG
#ifdef DEBUG
    when(is_cache_miss){ printf("Cache miss!") }
#endif
4

1 に答える 1

1

Chisel ifdef システムとして Scala コードを使用する必要があります。

if (DEBUG) // <<--- this is a Scala conditional, run at chisel build-time
    when (is_cache_miss) { printf("Cache miss!") } // << --- Chisel conditional. Executes every cycle of simulation. 
于 2015-07-30T20:13:30.457 に答える