忍者ブログ

EDA Blog

Verilog、SystemVerilog、SystemCなど、ハードウェア記述言語についてのブログです。

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

ソースコードのシンタックスハイライト

ソースコードをシンタックスハイライトする方法に関して、自分向けの備忘録。
ブログのソースコードに下記記述を入れる。

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/styles/atom-one-dark.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/highlight.min.js" type="text/javascript"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();
ブログに入れたいソースコードを<pre><code>...</code></pre>で囲む。
Verilogの例:

<pre><code>
always @(posedge clk) begin
    dout <= din;
end
</code></pre>

結果、このように表示される。

always @(posedge clk) begin
    dout <= din;
end
 

拍手[0回]

PR

SSE Bicubic

void gen_fx_fy_sse(const float &dx, const float &dy, float *fx, float *fy) {
    __declspec(align(16)) float float_all1 = 1.0, float_2 = 2.0, float_4 = 4.0, float_5 = 5.0, float_8 = 8.0;
    __declspec(align(16)) float float_0101[4] = { 1.0, 0.0, 1.0, 0.0 };
    __declspec(align(16)) float float_1212[4] = { 2.0, 1.0, 2.0, 1.0 };

    const __m128 sse_all1 = _mm_load1_ps(&float_all1);
    const __m128 sse_all2 = _mm_load1_ps(&float_2);
    const __m128 sse_all4 = _mm_load1_ps(&float_4);
    const __m128 sse_all5 = _mm_load1_ps(&float_5);
    const __m128 sse_all8 = _mm_load1_ps(&float_8);
    const __m128 *sse_0101 = (__m128 *)float_0101;
    const __m128 *sse_1212 = (__m128 *)float_1212;

    __m128 first = _mm_load1_ps(&dx);
    __m128 second = _mm_load1_ps(&dy);
    __m128 org = _mm_shuffle_ps(first, second, _MM_SHUFFLE(3,2,1,0));

    // 0.0 - 1.0
    __m128 res0 = _mm_addsub_ps(*sse_0101, org);
    __m128 mul2 = _mm_mul_ps(res0, res0);
    __m128 mul3 = _mm_mul_ps(mul2, res0);
    __m128 mul2by2 = _mm_mul_ps(sse_all2, mul2);
    res0 = _mm_sub_ps(sse_all1, mul2by2);
    res0 = _mm_add_ps(res0, mul3);

    // 1.0 - 2.0
    __m128 res1 = _mm_addsub_ps(*sse_1212, org);
    mul2 = _mm_mul_ps(res1, res1);
    mul3 = _mm_mul_ps(res1, mul2);
    res1 = _mm_sub_ps(sse_all4, _mm_mul_ps(sse_all8, res1));
    res1 = _mm_add_ps(res1, _mm_mul_ps(sse_all5, mul2));
    res1 = _mm_sub_ps(res1, mul3);
    __m128 fx0 = _mm_movelh_ps(res0, res1);
    __m128 fy0 = _mm_movehl_ps(res0, res1);

    _mm_store_ps(fx, _mm_shuffle_ps(fx0, fx0, _MM_SHUFFLE(2, 0, 1, 3)));
    _mm_store_ps(fy, _mm_shuffle_ps(fy0, fy0, _MM_SHUFFLE(0, 2, 3, 1)));
}

拍手[0回]

CentOSインストール

VMWare Playerインストール後、久しく何もしていなかったが今夜CentOSの.isoファイルをダウンロードしてインストール。
インストール後、yum updateを実行中。
明日にでもQuartus II v13.0をCentOS上にインストールしよう。

拍手[0回]

SHJSのテスト

SHJSを入れて、コードに色がつけられるようになった。
次は、背景に色をつけたい。

Tcl
puts "Hello, World!"
Perl
print "Hello, World!\n";
s/aaa/bbb/;
C
#include 

void main(void) {
    printf("Hello, World!\n");
}

拍手[0回]

HCE

EDA Design Guidelineのこの記事で、イタリアのYlichronという会社がANSI-Cから
VHDLを生成できる動作合成ツールをリリースしたと書かれています。
ターゲットはFPGA向けとのことです。
VisualStudioと統合されていて、C言語のソースを変えずにVHDLに落とせるそうです。
会社のホームページからは試用版をダウンロードできるようです。

ANSI-CからRTLを生成するという点ではImpulseC/CoDeveloperと同じですね。
確かForteもFPGA向けのCynthesizerをリリースするというニュースが今年あった
と記憶していますが、FPGA向けの動作合成も本格化してくるのかもしれません。

拍手[0回]

はじめまして

はじめまして。
Verilog、SystemVerilog、SystemCなど、ハードウェア記述言語について記述していく予定です。
ある程度まとまったら、ホームページに内容をまとめようと考えています。
よろしくお願いします。
 
 
 

拍手[0回]

カレンダー

03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

フリーエリア

最新CM

[04/11 なつたん]

最新TB

プロフィール

HN:
aston_martin
性別:
非公開

ブログ内検索

カウンター

アクセス解析