古川制御日記

佐賀県武雄市の組み込み開発屋ブログ

Avalon Packets to Transactions Converter Core

Transaction Packet Format

Byte Field Description
0 Transaction code Type of transaction. See Properties of Avalon-ST Interfaces table.
1 Reserved Reserved for future use.
[3:2] Size Transaction size in bytes. For write transactions the size indicates the size of the data field. For read transactions the size indicates the total number of bytes to read.
[7:4] Address 32-bit address for the transaction.
[n:8] Data Transaction data; data to be written for write transactions.

Response Packet Format

Byte Field Description
0 Transaction code The transaction code with the most significant bit inversed.
1 Reserved Reserved for future use.
[4:2] Size Total number of bytes read/written successfully.

Supported Transactions

Transaction Code Avalon-MM Transaction Description
0x00 Write non-incrementing address. Writes data to the given address until the total number of bytes written to the same word address equals to the value specified in the size field.
0x04 Write incrementing address. Writes transaction data starting at the given address.
0x10 Read non-incrementing address. Reads 32 bits of data from the given address until the total number of bytes read from the same address equals to the value specified in the size field.
0x14 Read incrementing address. Reads the number of bytes specified in the size field starting from the given address.
0x7f No transaction. No transaction is initiated. You can use this transaction type for testing purposes. Although no transaction is initiated on the Avalon-MM interface the core still returns a response packet for this transaction code.

f:id:fullphong:20171011230824p:plain

DesignSpark Mechanicalなどで使える3Dモデルの探し方

tracepartsonline.net ここだと、かなりいろんな形式のデータフォーマットで落とせる。 ダウンロードまでにちょっと時間かかる。

自分的には二列のピンヘッダーを結構使うのでこういう任意ピン数のデータが落とせるのは非常にありがたい。

メス側以下 http://www.tracepartsonline.net/(S(ijmz22zhvanjnplvtawsarif))/PartDetails.aspx?Class=ASSMANN&clsid=&ManID=ASSMANN&PartFamilyID=10-23062010-091210&PartID=10-23062010-091210&SrchRsltType=4&SrchRsltId=2

あとこういうよくあるタイプのコネクタはここで落としてる。 f:id:fullphong:20170330173133p:plain

J.S.T. Mfg. Co., Ltd.

http://www.3dcontentcentral.com/

PCB Cad Eagleの古いバージョンのダウンロード方法

というかダウンロードサイト
cadsoft.deのFTPサービスが生きているみたいですね。 以下から古いバージョン落とせます。
ftp://ftp.cadsoft.de/eagle/program/
ありがたやー

$ ftp ftp://ftp.cadsoft.de/eagle/program/

Connected to cheetah.cadsoft.de.
220-Welcome to the CadSoft Computer FTP service.
220-Please log in as "anonymous" or "ftp".
220
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
250 Directory successfully changed.
250 Directory successfully changed.
ftp>
ftp> ls
229 Entering Extended Passive Mode (|||30096|)
150 Here comes the directory listing.
lrwxrwxrwx    1 10001    2001            6 Feb 01  2006 4.0 -> 4.09r2
dr-xr-xr-x    2 10001    2001         4096 Jan 29  2015 4.09r2
lrwxrwxrwx    1 10001    2001            6 Dec 13  2006 4.1 -> 4.16r2
dr-xr-xr-x    2 10001    2001         4096 Dec 19  2006 4.16r2
lrwxrwxrwx    1 10001    2001            4 Aug 29  2013 5.0 -> 5.12
dr-xr-xr-x    2 10001    2001         4096 Dec 13  2011 5.12
dr-xr-xr-x    2 10001    2001         4096 Jun 02  2014 6.6
dr-xr-xr-x    2 10001    2001         4096 Jul 14  2014 7.0
drwxr-xr-x    2 10001    2001         4096 Aug 11  2014 7.1
dr-xr-xr-x    2 10001    2001         4096 Nov 27  2014 7.2
dr-xr-xr-x    2 10001    2001         4096 May 11  2015 7.3
dr-xr-xr-x    2 10001    2001         4096 Aug 31  2015 7.4
dr-xr-xr-x    2 10001    2001         4096 Jan 26  2016 7.5
dr-xr-xr-x    2 10001    2001         4096 May 18  2016 7.6
dr-xr-xr-x    2 10001    2001         4096 Oct 05 09:16 7.7
lrwxrwxrwx    1 10001    2001            3 Oct 05 11:25 latest -> 7.7
226 Directory send OK.
ftp> 

当方4.16r2のライセンスしかもっておらず未だにこれを使ってますが、KiCadに移行するか考え中。
とりあえず今の仕事まではEagle4.16r2にお世話になろう。

Eagle PCB CAD「Board and shcematic are not consistent!」時の対策

Board and shcematic are not consistent!
No forward-/backannotation will be performed!
Use the ERC command to get a detailed error report.

何がきっかけなのかわからないがたまにこれが発生する。
この状態だとSchematic側で部品を追加してもBoard側には反映されなくなる。何しろすでに一貫性ないから、無い一貫性を維持しようがない。

このときのこの症状が発生したときのERCの結果メッセージは以下ような内容を含んでいる(はず)。

Pins/Pads with different connections:

  Part     Gate     Pin        Net      Pad      Signal

  CN5      G$1      GND        GND/2    7        N$63
  U16      A        I4         GND/3    4       
  U16      A        I5         GND/3    5       
  U16      A        I6         GND/3    6       
  U16      A        I7         GND/3    7       

このときの対策としてまずは、

  • Schematic側でCN5,U16を削除する。
  • Board側でCN5,U16を削除する。

という手順を実施すれば一貫性は復活する(はず)。
一貫性が復活したのちは再びCN5であった部品とU16であった部品を手動で追加すればOK。

ということがわかったのでメモった。

Lattice Diamondの回路図記述回路(.schファイル)をModelSIMでシミュレーション

Lattice Diamondのスケマティック(.schファイル)記述はVHDLに自動的に変換されるのでそれを使えばModelSIMでシミュレーションすることができます。
が、以下のように

library xp2;
use xp2.components.all;

Lattice製のコンポーネントに依存したVHDLに変換されます。
これらのコンポーネントにはor2,inv,nr2などの論理素子が含まれ、ソースコードC:\lscc\diamond\3.8\cae_library\simulation\vhdlにありました。 これらをModelSIMのプロジェクトに含めてコンパイルしても

** Error: src.vhd(5): (vcom-1598) Library "xp2" not found.
** Error: src.vhd(6): (vcom-1136) Unknown identifier "xp2".
** Error: src.vhd(8): VHDL Compiler exiting

と言われて失敗するので、

xp2ライブラリとしてコンパイルしたいファイル群を選択してProperties...右クリックメニューを開いて

f:id:fullphong:20170306132238p:plain

としたのちTranscriptウィンドウから

vlib xp2

と入力後、コンパイル及び実行できました。

lwIPを使うにあたって

sys_arch.txtを読んでみた

  • sys_archっていうのは、lwIPを使うプログラマーが用意するべき、sys_arch.hとsys_arch.cのことを言っているんだと思う。
    なのでsys_archを用意すれば、ユーザープログラムからlwIP機能を使うことができるんだろう。

  • sys_archはセマフォとメールボックス機能をlwIP側に提供することで、ユーザープログラムとやりとりできる。

  • メールボックスは複数メッセージQueueモードと、単発メッセージランデブーモードがある。
    メールボックスのコンテンツであるメッセージはただのポインタでそれ以外の何物でもない。

  • セマフォはsys_sem_tというtypedefされた型であり、これはsys_arch.hに定義されるものであり、sys_arch.hはユーザーが定義するものであります。
    ユーザー定義のsys_arch.hをlwIPからインクルードしてもらう。

ブロック図とか書くのに使えそうな文字

0123456789abcdef
e2 94 80
e2 94 90
e2 94 a0
e2 94 b0
0123456789abcdef
e2 95 80
e2 95 90
e2 95 a0
e2 95 b0

UTF8 3byte(e2)

Vivado 自動化

とあるエンジニアの備忘log: Zynq のビルドプロセスをスクリプト化する

Xilinx Vivadoで上手にバージョン管理する方法 - aster_ismの工作室