[388] | 1 | # -*- coding: utf-8 -*-
|
---|
| 2 | #
|
---|
| 3 | # TECS Generator
|
---|
| 4 | # Generator for TOPPERS Embedded Component System
|
---|
| 5 | #
|
---|
| 6 | # Copyright (C) 2008-2017 by TOPPERS Project
|
---|
| 7 | #--
|
---|
| 8 | # 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
| 9 | # ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
| 10 | # 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
| 11 | # (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
| 12 | # 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
| 13 | # スコード中に含まれていること.
|
---|
| 14 | # (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
| 15 | # 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
| 16 | # 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
| 17 | # の無保証規定を掲載すること.
|
---|
| 18 | # (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
| 19 | # 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
| 20 | # と.
|
---|
| 21 | # (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
| 22 | # 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
| 23 | # (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
| 24 | # 報告すること.
|
---|
| 25 | # (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
| 26 | # 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
| 27 | # また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
| 28 | # 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
| 29 | # 免責すること.
|
---|
| 30 | #
|
---|
| 31 | # 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
| 32 | # よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
| 33 | # に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
| 34 | # アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
| 35 | # の責任を負わない.
|
---|
| 36 | #
|
---|
| 37 | # $Id$
|
---|
| 38 | #++
|
---|
| 39 |
|
---|
| 40 | class TECSGEN
|
---|
| 41 |
|
---|
| 42 | #------ manupulate location information --------#
|
---|
| 43 | def self.new_cell_location cell_location
|
---|
| 44 | @@current_tecsgen.new_cell_location cell_location
|
---|
| 45 | end
|
---|
| 46 | def new_cell_location cell_location
|
---|
| 47 | @cell_location_list << cell_location
|
---|
| 48 | end
|
---|
| 49 | def get_cell_location_list
|
---|
| 50 | @cell_location_list
|
---|
| 51 | end
|
---|
| 52 |
|
---|
| 53 | def self.new_join_location join_location
|
---|
| 54 | @@current_tecsgen.new_join_location join_location
|
---|
| 55 | end
|
---|
| 56 | def new_join_location join_location
|
---|
| 57 | @join_location_list << join_location
|
---|
| 58 | end
|
---|
| 59 | def get_join_location_list
|
---|
| 60 | @join_location_list
|
---|
| 61 | end
|
---|
| 62 |
|
---|
| 63 | #== Cell_location
|
---|
| 64 | # tecscde の位置情報
|
---|
| 65 | class Cell_location
|
---|
| 66 |
|
---|
| 67 | #=== Join_location#initialize
|
---|
| 68 | #cell_nspath::NamespacePath
|
---|
| 69 | #x,y,w,h::Expression
|
---|
| 70 | #port_location_list::[ [Symbol(ep_or_cp_name), Symbol(edge_name), Expression(offset)], ... ]
|
---|
| 71 | #ep_name::Symbol
|
---|
| 72 | def initialize( cell_nspath, x, y, w, h, port_location_list )
|
---|
| 73 | # p "Cell_location: #{cell_nspath}, #{x}, #{y}, #{w}, #{h}, #{port_location_list}"
|
---|
| 74 | @cell_nspath = cell_nspath
|
---|
| 75 | @x = x.eval_const nil
|
---|
| 76 | @y = y.eval_const nil
|
---|
| 77 | @w = w.eval_const nil
|
---|
| 78 | @h = h.eval_const nil
|
---|
| 79 | @port_location_list = port_location_list
|
---|
| 80 |
|
---|
| 81 | TECSGEN.new_cell_location self
|
---|
| 82 | end
|
---|
| 83 |
|
---|
| 84 | def get_location
|
---|
| 85 | [ @cell_nspath, @x, @y, @w, @h, @port_location_list ]
|
---|
| 86 | end
|
---|
| 87 |
|
---|
| 88 | end # Cell_location
|
---|
| 89 |
|
---|
| 90 | #== Join_location
|
---|
| 91 | # tecscde の位置情報
|
---|
| 92 | class Join_location
|
---|
| 93 | @@join_location_list = []
|
---|
| 94 |
|
---|
| 95 | #=== Join_location#initialize
|
---|
| 96 | #cp_cell_nspath::NamespacePath
|
---|
| 97 | #cp_name::Symbol
|
---|
| 98 | #ep_cell_nspath::NamespacePath
|
---|
| 99 | #ep_name::Symbol
|
---|
| 100 | #bar_list::[[Symbol (VBar or HBar), Expression(position mm)], ....]
|
---|
| 101 | def initialize( cp_cell_nspath, cp_name, ep_cell_path, ep_name, bar_list )
|
---|
| 102 | # p "Join_location #{cp_cell_nspath}, #{cp_name}, #{ep_cell_path}, #{ep_name} #{bar_list}"
|
---|
| 103 | @cp_cell_nspath = cp_cell_nspath
|
---|
| 104 | @cp_name = cp_name
|
---|
| 105 | @ep_cell_path = ep_cell_path
|
---|
| 106 | @ep_name = ep_name
|
---|
| 107 | @bar_list = bar_list
|
---|
| 108 |
|
---|
| 109 | TECSGEN.new_join_location self
|
---|
| 110 | end
|
---|
| 111 |
|
---|
| 112 | def get_location
|
---|
| 113 | [@cp_cell_nspath, @cp_name, @ep_cell_path, @ep_name, @bar_list]
|
---|
| 114 | end
|
---|
| 115 |
|
---|
| 116 | end # Join_location
|
---|
| 117 |
|
---|
| 118 | end # TECSGEN
|
---|