#!/bin/sh
#
# Test results last captured at "Wed Mar  9 19:49:57 PST 2005"
#
# This is an IBIS icm test program
#
# It is a self-contained package of all of the 
# files and data required to run an icm parser test.
#
# Usage:  ./test_237  <arg>
#
# <nothing>               = Run the test silently in GNU check mode
# "Brief"                 = Run the test.
#                           If there is no error, produce a one line summary
#                           Otherwise, produce a full test report.
# "Full"                  = Run the test and always produce a full test report
# "Capture"               = Capture test results and REWRITE the test program
# "Extract"               = Extract the .icm and .out files
#

Test=`basename $0`
Synopsis="[S-parameter] requires subparameter Port_assignment"
ExitStatus="1"
Counters="ERRORS: 6 WARNINGS: 0"
ExtraFiles="model_example.jpg secta.s4p sectb.s4p sectc.s4p"

Description=`grep -v '^EOF$' <<'EOF'
This test omits an [S-parameter] Port_assignment subparameter.

Errors are expected.
EOF`

Output=`grep -v '^EOF$' <<'EOF'
IBIS ICM Parser, version 1.1.0
ERROR (Line 91/Col 1) Section 'SectB' [S-parameter] Port_assignment is missing.
ERROR (Line 46/Col 3) N_section 'SectB' node count (4) does not match Port_assignment Node count (0).
ERROR (Line 46/Col 3) N_section 'SectB' Node 'AB1' is not present in the [S-parameter] Port_assignment.
ERROR (Line 46/Col 3) N_section 'SectB' Node 'AB2' is not present in the [S-parameter] Port_assignment.
ERROR (Line 46/Col 3) N_section 'SectB' Node 'BC1' is not present in the [S-parameter] Port_assignment.
ERROR (Line 46/Col 3) N_section 'SectB' Node 'BC2' is not present in the [S-parameter] Port_assignment.
Finished. ERRORS: 6 WARNINGS: 0
EOF`

ICM=`grep -v '^EOF$' <<'EOF'

|
|**********************************************************************
[Begin Header]
[ICM Ver]             1.1
[File Name]           test_237.icm
[File Rev]            0.1
[Date]                March 17, 2003
[Source]              Created by Michael Mirmak, Intel Corp.
[Notes]               This file shows how the ICM specification, at
                      level 1.0a, would implement an S-parameter 
                      description of an interconnect.
[Disclaimer]          No license, express or implied, by estoppel or 
                      otherwise, to any intellectual property rights is 
                      granted by this document. 
[Copyright]           None - public domain
[Support]             http://www.vhdl.org/pub/ibis/
[Redistribution]      Yes    
[Redistribution Text] Stick your favorite T's and C' here! 
[End Header]
|**********************************************************************
|
[Comment Char] |_char
|
|**********************************************************************
[Begin ICM Family]        S_parameter_example
[Manufacturer]            None
[ICM Family Description]  
A very crude s-parameter example for parsing and analysis.
|**********************************************************************
[ICM Model List] 
|  Name             Mating   Min_Slew_Time           Image
MyModelExample1     Mated       100ps            model_example.jpg
MyModelExample2     Mated       100ps            model_example.jpg
|
|          SectA       SectB       SectC   
| Port1 >---------< >---------< >---------<  Port2
|
|**********************************************************************
[Begin ICM Model] MyModelExample1
ICM_model_type S-parameter
|
[Nodal Path Description]
  Model_nodemap MyModelNodeMapA
  N_section ( A1  A2    AB1 AB2 ) Mult=1 SectA
  N_section ( AB1 AB2   BC1 BC2 ) Mult=1 SectB
  N_section ( BC1 BC2   C1  C2  ) Mult=1 SectC
  Model_nodemap MyModelNodeMapC
|
[End ICM Model]
|
[Begin ICM Model] MyModelExample2
ICM_model_type SLM_general
SGR 1:1
[Nodal Path Description]
  Model_nodemap MyModelNodeMapA
  N_section ( A1  A2    AB1 AB2 ) Mult=1 SectA_rlgc
  N_section ( AB1 AB2   BC1 BC2 ) Mult=1 SectB_rlgc
  N_section ( BC1 BC2   C1  C2  ) Mult=1 SectC_rlgc
  Model_nodemap MyModelNodeMapC
|
[End ICM Model]
|
|**********************************************************************
[ICM Node Map] MyModelNodeMapA
|Pin Node Name
 1   A1   AD12_IN
 2   A2   AD15_IN

[ICM Node Map] MyModelNodeMapC
|Pin Node Name
 1   C1   AD12_OUT
 2   C2   AD15_OUT

[End ICM Family]
|
|**********************************************************************
[Begin ICM Section] SectA
[Derivation Method] Lumped
[ICM S-parameter]
File_name secta.s4p
Port_assignment
| Port Node
1   A1
2   A2
3   AB1
4   AB2
[End ICM Section]

|**********************************************************************
[Begin ICM Section] SectB
[Derivation Method] Lumped
[ICM S-parameter]
File_name sectb.s4p
[End ICM Section]

|**********************************************************************
[Begin ICM Section] SectC
[Derivation Method] Lumped
[ICM S-parameter]
File_name sectc.s4p
Port_assignment
| Port Node
1   BC1
2   BC2
3   C1
4   C2
[End ICM Section]

|**********************************************************************
[Begin ICM Section] SectA_rlgc
[Derivation Method] Lumped
[Resistance Matrix] Diagonal_matrix
1.0mohm
1.0e-3
[Inductance Matrix] Diagonal_matrix
4.0nh
4.0e-9
[Capacitance Matrix] Diagonal_matrix
2.0pf
2.0e-12
[End ICM Section]

|**********************************************************************
[Begin ICM Section] SectB_rlgc
[Derivation Method] Lumped
[Resistance Matrix] Diagonal_matrix
1.0mohm
1.0e-3
[Inductance Matrix] Diagonal_matrix
4.0nh
4.0e-9
[Capacitance Matrix] Diagonal_matrix
2.0pf
2.0e-12
[End ICM Section]

|**********************************************************************
[Begin ICM Section] SectC_rlgc
[Derivation Method] Lumped
[Resistance Matrix] Diagonal_matrix
1.0mohm
1.0e-3
[Inductance Matrix] Diagonal_matrix
4.0nh
4.0e-9
[Capacitance Matrix] Diagonal_matrix
2.0pf
2.0e-12
[End ICM Section]

|**********************************************************************
[End]
|**********************************************************************
EOF`

#
# we are either running the test directly in the test directory
# or are running make check.  make sets the srcdir variable
# so we can tell the difference easily
#

if [ -z "${srcdir}" ]
then
    srcdir="."
    exedir="../../src"
else
    srcdir="${srcdir}/v_1_1"
    exedir="../src"
fi

export srcdir exedir Test Synopsis ExitStatus Counters ExtraFiles Description Output ICM

exec ${srcdir}/run_test "$@"
