aki_iic’s blog

己の欲せざる処人に施す事無かれ、狂人の真似するは即ち狂人なり

PSD8XXのエコシステムについての覚え書き(その2)

 PSD8XXのエコシステムについての覚え書きの続き

aki-iic.hatenablog.com

 個人Blogというのは書きたい事を書けると勝手に思っているので(どうか寛大なるご理解/スルー力を:)今度はPSDSoftExpressについてダイジェスト的にご紹介。

3.PSDSoftExpressの起動画面

PSDSoftExpress起動画面

 操作は画面左のフローに従ってウィザード形式と申しますか各ブロック毎に処理を進めて行く形になります。

3.1 フローの意味

PSDSoftExpressトップ画面

3.1.1 Specify Project:プロジェクトの定義

3.1.2 Define PSD and MCU/DSP:PSDとMCUDSPの定義

3.1.3 Define PSD Pin / Node Functions:PSDのPinと機能の定義。

 ここが重要でほぼこの中での作業が中心となります(後述)。

3.1.4 Additional PSD Settings:オプション定義(無視で無問題)

3.1.5 Fit Design to Silcon:コンパイル、チェック、結果出力

3.1.6 Merge MCU/DSP Firmware with PSD:Flashに書き込むファームウェアのデータをマージしてメタデータを作成

3.1.7 JTAG ISP:RLINK等の書き込みツールがUSB接続されている場合、3.1.6のデータをPSDにJTAGで書き込む。当然ながらターゲットボードには所定のJTAGコネクタ(14Pinが標準)が必要です。

 

4.(3.1.3)Define PSD Pin/Node Functinsの操作詳細

 4.1 Pinの定義:

Define PSD Pin

 画面左に割当られるPinが表示され、画面右に定義する内容が表示されます。ここで定義したPinが以後の名称となるので所定のルール(8文字以内とか)に従い命名する必要があります(8.3ルールのご時世なのでファイル名もそれに制約されます・・・20世紀末のロングファイルネームが一般的ではなかった時代のソフトなので:)

 定義できる内容はPinにより異なりますがPLDのIN/OUT,IOport等が可能な場合が多いです(入力専用な物もある)。

 尚、PLDのステートマシン等のPinに出力されない内部ノードはここではなく別の所で定義するので入力不要です(27MCのPLDだがCPLDに近い印象、あるいは末期のPLDか)。

4.2 SRAM/IO/Flashのメモリマップ・デコード条件の定義

PSDのSRAM/IO/Flashのアドレス・デコード条件定義

 画面左が定義対象の要素(rs0:SRAM,csiop:IO,fs0-7:Flash(32KBx8))で真ん中のフィールドにアドレスとデコード条件を入力すれば良いです。この例ではZ180用なので!nMREQ(間違えてますね)とアドレス領域のand(&)されたデコード条件となります。

 こんな感じで入力すればAbelの式を合成してくれる(無論、確認の為にAbelの論理式は読めないといけませんがverilogVHDL世代の方には簡単というか低レベルかと。

4.3 Logic equation(論理式の定義)

PSD logic equations

 ここでは所謂 logic equationを定義します。画面左が定義対象で真ん中が記述する論理式、右が記述可能な論理と要素です。この例だと:

 nRAM = !(!nMREQ & A18) ;

 みたいな形に合成されます。穴埋め形式なので言語仕様がうんちゃらかんちゃらとか面倒な(ハードエンジニアには不要な)些末は不要で書くべき事を書けば良いです。

4.4 User-defined Node Equation(ユーザ定義ノード)

PSD user-defined node equations

 ここではPinに出力されない内部ノードの定義を行います。画面の例では、

 cds = !nIORQ & !a7 & !a6 & !a5 & a4 & !a3 ;

を内部ノードとして定義しています。当然これを他のLogic Equation等で参照する事が出来ます。所謂PLDの内部ノード(CPLDや高機能PLDでは使いますよね。ステートマシンにも好適:)という訳です。

 内部ノードは組み合わせ回路とFF(D/JK/SR)が選択可能であり、それに応じて各ノードの定義を行う必要があります。

4.5 Fit Design to Silicon(所謂コンパイル

PSD Fit Design to Silicon(一部)

 こんな感じで合成された情報が出力されます。長いですが全部を貼り付けておきます↓

******************************************************************************************
                               PSDsoft Express Version 8.66
                                   Output of PSD Fitter
******************************************************************************************
  PROJECT    : z180_v0                          DATE : 09/23/2025
  DEVICE     : PSD834F2                         TIME : 14:46:12
  FIT OPTION : Keep Current
  DESCRIPTION: z180 sbc
                
******************************************************************************************
     ==== Pin Layout for J (52-Pin PLCC) Package Type ====

                                               -----------------------------
                                              |                             |
                                              |1 ] GND               pa2 [27| Data Port d2, d2
                                    nFT245RXF |2 ] pb5               pa1 [28| Data Port d1, d1
                                    nFT245TXE |3 ] pb4               pa0 [29| Data Port d0, d0
                                        nIOWR |4 ] pb3             adio0 [30| Address Bus a0, a0
                                          nCF |5 ] pb2             adio1 [31| Address Bus a1, a1
                                         nRAM |6 ] pb1             adio2 [32| Address Bus a2, a2
                                          CLK |7 ] pb0             adio3 [33| Address Bus a3, a3
                                          a19 |8 ] pd2             adio4 [34| Address Bus a4, a4
                                          a18 |9 ] pd1             adio5 [35| Address Bus a5, a5
                                          a17 |10] pd0             adio6 [36| Address Bus a6, a6
                                        nIORQ |11] pc7             adio7 [37| Address Bus a7, a7
                                     tdo, TDO |12] pc6/TDO           VCC [38|  
                                     tdi, TDI |13] pc5/TDI         adio8 [39| Address Bus a8, a8
                                        nMREQ |14] pc4/TERR        adio9 [40| Address Bus a9, a9
                                              |15] VCC            adio10 [41| Address Bus a10, a10
                                              |16] GND            adio11 [42| Address Bus a11, a11
                                      FT245WR |17] pc3/TSTAT      adio12 [43| Address Bus a12, a12
                                     nFT245RD |18] pc2            adio13 [44| Address Bus a13, a13
                                     tck, TCK |19] pc1/TCK        adio14 [45| Address Bus a14, a14
                                     tms, TMS |20] pc0/TMS        adio15 [46| Address Bus a15, a15
                             d7 ,Data Port d7 |21] pa7             cntl0 [47| _wr
                             d6 ,Data Port d6 |22] pa6             reset [48| _reset
                             d5 ,Data Port d5 |23] pa5             cntl2 [49| a16
                             d4 ,Data Port d4 |24] pa4             cntl1 [50| _rd
                             d3 ,Data Port d3 |25] pa3               pb7 [51| pb7
                                              |26] GND               pb6 [52| nIORD
                                              |                             |
                                               -----------------------------
     ==== Global Configuration ====

Data Bus                                                         : 8-Bit
Address/Data Mode                                                : Non-Multiplexed
ALE/AS Signal                                                    : Off
Control Signals                                                  : /WR, /RD
Enable Chip-Select Input(/CSI)                                   : OFF
Standby Voltage Input (PC2)                                      : OFF
Standby-on Indicator (PC4)                                       : OFF
RDY/Busy function (PC3)                                          : OFF
Load Micro-Cell on                                               : edge
Security Protection                                              : OFF 

     ==== Address & Data Bus Assignment ====

 Stimulus Bus Name     Signal Description
 ---------------------------------------------------------
 `adiol = adio[7:0]  = Address Bus a[7:0]
 `adioh = adio[15:8] = Address Bus a[15:8]
  adio  = adio[15:0] = Address Bus a[15:0]

  data  = data[7:0]  = Data Port d[7:0]


     ==== DataBus_IMC access information ====

                  CSIOP
Location     Address Offset     Register Name           Signals
--------------------------------------------------------

     ===== Resource Usage Summary =====

Total Product Terms Used:  36

Device Resources                    used / total
------------------------------------------------
Port A: (pins 29 28 27 25 24 23 22 21)
I/O Pins :                           8   /  8 
   MCU I/O or Address Out       :    0 
   Peripheral I/O               :    0 
   Logic Inputs                 :    0 
   Address Latch Inputs         :    0 
   PT Dependent Latch Inputs    :    0 
   PT Dependent Register Inputs :    0 
   Combinatorial Outputs        :    0 
   Registered Outputs           :    0 
   Data Port                    :    8 
Other Information
   Microcells                   :    5   /  8 
     Micro-Cells AB :
      Buried Microcells         :    5 
      Output Microcells         :    0 
   Product Terms                :    8   /  24
   Control Product Terms        :    6   /  34

Port B: (pins 7 6 5 4 3 2 52 51)
I/O Pins :                           8   /  8 
   MCU I/O or Address Out       :    3 
   Logic Inputs                 :    1 
   Address Latch Inputs         :    0 
   PT Dependent Latch Inputs    :    0 
   PT Dependent Register Inputs :    0 
   Combinatorial Outputs        :    4 
   Registered Outputs           :    0 
Other Information
   Microcells                   :    6   /  8 
     Micro-Cells AB :
      Buried Microcells         :    2 
      Output Microcells         :    2 
     Micro-Cells BC :
      Buried Microcells         :    0 
      Output Microcells         :    2 
   Product Terms                :    9   /  26
   Control Product Terms        :    8   /  34

Port C: (pins 20 19 18 17 14 13 12 11)
I/O Pins :                           8   /  8 
   MCU I/O or Address Out       :    0 
   Logic Inputs                 :    1 
   Address Latch Inputs         :    1 
   PT Dependent Latch Inputs    :    0 
   PT Dependent Register Inputs :    0 
   JTAG signals                 :    4 
   Standby Voltage Input        :    0 
   Rdy/Bsy signal               :    0 
   Standby On Indicator         :    0 
   Control Signal Input         :    0 
   Combinatorial Outputs        :    2 
   Registered Outputs           :    0 
Other Information
   Microcells                   :    4   /  8 
     Micro-Cells BC :
      Buried Microcells         :    2 
      Output Microcells         :    2 
   Product Terms                :    4   /  32
   Control Product Terms        :    3   /  34
      Allocated locally         :    2 
      Allocated to other port   :    1 

Port D: (pins 10 9 8)
I/O Pins :                           3   /  3 
   MCU I/O or Address Out       :    0 
   Logic Inputs                 :    3 
   Chip-Select Input            :    0 
   Clock Input                  :    0 
   Control Signal Input         :    0 
   Fast Decoding Outputs        :    0 
Other Information
   Product Terms                :    0   /  3 
   Control Product Terms        :    0   /  3 


     ==== OMC Resource Assignment ====

  Resources           PT             User
  Used                Allocation     Name
 ---------------------------------------------------------
Micro-Cell AB :
  Micro-Cells 0        -             rdd => Register
  Micro-Cells 1        -             csd => Register
  Micro-Cells 2        -             nCF (mcellab2)  => Combinatorial
  Micro-Cells 3        -             nIOWR (mcellab3)  => Combinatorial
  Micro-Cells 4       Yes            fs7_0 => Combinatorial

Micro-Cell BC :
  Micro-Cells 1        -             nRAM (mcellbc1)  => Combinatorial
  Micro-Cells 2        -             nFT245RD (mcellbc2)  => Combinatorial
  Micro-Cells 3        -             FT245WR (mcellbc3)  => Combinatorial
  Micro-Cells 6        -             nIORD (mcellbc6)  => Combinatorial

External Chip Select :


     ========= Equations =========

DPLD          EQUATIONS :
=======================
     fs0 = !pdn & !a16 & !a15 & nMREQ & !a19 & !a18 & !a17;

     fs1 = !pdn & !a16 & a15 & nMREQ & !a19 & !a18 & !a17;

     fs2 = !pdn & a16 & !a15 & nMREQ & !a19 & !a18 & !a17;

     fs3 = !pdn & a16 & a15 & nMREQ & !a19 & !a18 & !a17;

     fs4 = !pdn & !a16 & !a15 & nMREQ & !a19 & !a18 & a17;

     fs5 = !pdn & !a16 & a15 & nMREQ & !a19 & !a18 & a17;

     fs6 = !pdn & a16 & !a15 & nMREQ & !a19 & !a18 & a17;

     fs7 = fs7_0.FB;

     csiop = !pdn & !a16 & !a15 & !a14 & !a13 & !a12 & !a11 & !a10 & !a9 & !a8 & a7 & nIORQ & !a19 & !a18 & !a17;

     rs0 = !pdn & !a16 & a15 & a14 & a13 & a12 & nMREQ & !a19 & !a18 & !a17;

PORTA         EQUATIONS :
=======================
     rdd.D := _rd;
     rdd.PR = 1;
     rdd.RE = _reset;
     rdd.C = CLK;

     csd.D := !a7 & !a6 & !a5 & a4 & !a3 & !nIORQ;
     csd.PR = 1;
     csd.RE = _reset;
     csd.C = CLK;

     fs7_0 = (!pdn & a16 & a15 & a14 & nMREQ & !a19 & !a18 & a17)
          # (!pdn & a16 & a15 & a13 & nMREQ & !a19 & !a18 & a17)
          # (!pdn & a16 & a15 & a12 & nMREQ & !a19 & !a18 & a17)
          # (!pdn & a16 & a15 & a11 & a10 & a9 & a8 & a7 & a6 & a5 & a4 & a3 & a2 & a1 & a0 & nMREQ & !a19 & !a18 & a17);

PORTB         EQUATIONS :
=======================
     CLK.LE = 1;

     !nRAM = !nMREQ & a18;
     nRAM.OE = _reset;

     !nCF = (!a7 & !a6 & !a5 & a4 & !a3 & !nIORQ)
          # (csd.Q);
     nCF.OE = _reset;

     !nIOWR = !_wr & !nIORQ;
     nIOWR.OE = _reset;

     !nIORD = !rdd.Q & !_rd & !nIORQ;
     nIORD.OE = _reset;

     pb7.OE = _reset;

PORTC         EQUATIONS :
=======================
     !nFT245RD = !a7 & !a6 & !a5 & !a4 & !a3 & a2 & !a1 & !a0 & !nIORQ;
     nFT245RD.OE = _reset;

     FT245WR = !a7 & !a6 & !a5 & !a4 & !a3 & a2 & !a1 & !a0 & !nIORQ;
     FT245WR.OE = _reset;

     nIORQ.LE = 1;

PORTD         EQUATIONS :
=======================
                                      ---  End  ---

引用おわり。

 まあ、こんな感じでPSDSoftExpressさんが合成・出力してくれる訳です。

4.6 Merge MCU/DSP Firmware with PSD

Merge MCU/DSP firmware with PSD

 こんな画面でfs0-7で定義した領域と論理式が表示されるので書き込みたいファームウェアを選択しておきます。ここで重要なのは:

#ファイル形式はIntel以外は使えない(Motでは無視される)

 という点でしょうか(こことても重要)。

これでOkすればメタデータが生成されるので後はJTAGISPすれば作業終了となります。

4.7 JTAG ISP

PSDSoft Express JTAG ISP

 JTAG ISPを行う画面ですがwine上なのであくまで疑似:)無論、VMWare等で実際にUSB接続のISPツール(RLINK等)が接続されていて、ターゲットとの接続が正常であれば、Executeボタン押下でerase⇒program⇒verigy(設定による)が行われ、Flash,IO,PLDのJTAG Programmingが行われます。

4.8 メモリ内容の確認(Conventional Programmers)

PSDsoftExpress (Conventional Programmer)

 4.6で生成したメタデータファームウェア)の内容を確認する画面です。該当する領域にファームウェアが適切に配置されているか確認する時に重宝します(意外と間違える事があります:)

 

5.おまけ

 何故当方がこの部品を使っている(Obsoluteでマイナなのに)かと言えば、

FlashもPLDもIOも全てJTAGISP出来るから、つまりROMライタと実機の間を往復しなくて済むから。

 なんですねぇ。何と無精者の発想というか人間一度手に入れた既得権は手放したくないというか・・・そういう怠け者思考でありました。

Obsoluteな部品だけど:)

おしまい