Fóruns: Ajuda (Thread #25445)

CRE_MPLの不具合? (2010-02-17 08:34 by easygo #48643)

V850ESで利用させて頂いております。

CRE_MPLにて生成した可変長メモリプールに対してpget_mplを実行すると取得に失敗します。
どうやらコンフィグレータ(hos4cfg)が生成するコード(kernel_cfg.c)に誤りがあるようです。

以下が該当箇所です

/* fixed size memory-pool area */
static VP kernel_mpl1_heap[(((2048) + sizeof(VP) - 1) / sizeof(VP))];

/* variable size memory-pool control block for rom area */
const T_KERNEL_MPLCB_ROM kernel_mplcb_rom[1] =
{
{(ATR)(TA_TFIFO), (SIZE)sizeof(kernel_mpl1_heap[0]), (VP)kernel_mpl1_heap},
};

ヒープサイズの定義が(SIZE)sizeof(kernel_mpl1_heap[0])となってしまっており
ポインタのサイズ(4byte)がヒープサイズとして定義されてしまいます。

正しくは、(SIZE)sizeof(kernel_mpl1_heap)ではないでしょうか?
コンフィグレータを修正することで解決しておりますが、念のためご連絡いたします。

Responder a #48643×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-18 01:01 by m-arai #48679)

CRE_MPFにも同じ病があるようですね。
Responder a #48643

Responder a #48679×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-18 09:12 by hamayan #48681)

同じジェネレータだからだとは思いますが、固定長メモリプールでも発生していますね。
Responder a #48679

Responder a #48681×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-18 09:31 by hamayan #48682)

取り敢えずconfigの中のcrempl.cppの186行目辺りの
"(SIZE)sizeof(kernel_mpl%d_heap[0]), (VP)kernel_mpl%d_heap},\n",

"(SIZE)sizeof(kernel_mpl%d_heap), (VP)kernel_mpl%d_heap},\n",
で再コンパイルしてみては如何でしょうか。

同様に固定長メモリプールではcrempf.cppの190行目辺りの
"(SIZE)sizeof(kernel_mpf%d_heap[0]), (VP)kernel_mpf%d_heap},\n",

"(SIZE)sizeof(kernel_mpf%d_heap), (VP)kernel_mpf%d_heap},\n",
ですか。

問題を見つけていただいて感謝しています。
Responder a #48643

Responder a #48682×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-18 09:44 by hamayan #48683)

ごめんなさい、固定長メモリプールの場合はこれに当たらないかも。
Responder a #48682

Responder a #48683×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Responder a #48684×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-18 09:56 by hamayan #48685)

m-araiさん、直してもらってすいません。
固定長メモリプールはメモリブロックのサイズを指すので元が正しい様です。

本当にすいません。
Responder a #48684

Responder a #48685×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-18 10:18 by m-arai #48686)

失礼しました。最初にデムパを飛ばしたのは私です。
固定長はメモリブロック数、ブロックサイズなので、
元のままで良いのでした。

http://sourceforge.jp/cvs/view/hos/hos/hos-v4/config/crempf.cpp?r1=1.10&r2=1.11
Responder a #48685

Responder a #48686×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: CRE_MPLの不具合? (2010-02-21 18:10 by ryuz #48803)

反応遅れてすみません。Ryuz@バグの犯人です。

バグレポ並びに、修正有難うございました。 > 皆様

MPF先に作って、それをベースにMPL作成して、しくじっていたようです。
私自身あまりMPL使う機会が無くて長らく埋まっていたようですみません。

組込みの特性上、以前はMPLはあまり好まれない風潮がありましたが、最近はリソースに余裕があるケースも増えてきましたのでもっとリッチなヒープアルゴリズムを検討しても良いのかもしれませんね。
可変長という特性上、リアルタイム保証しにくいのが困ったものです。
Responder a #48686

Responder a #48803×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login