OpenCores
URL https://opencores.org/ocsvn/xenie/xenie/trunk

Subversion Repositories xenie

[/] [xenie/] [trunk/] [examples/] [Eth_example/] [mb_fw/] [drivers/] [iic_v3_4/] [data/] [iic_tapp.tcl] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 DFC
###############################################################################
2
#
3
# Copyright (C) 2005 - 2014 Xilinx, Inc.  All rights reserved.
4
#
5
# Permission is hereby granted, free of charge, to any person obtaining a copy
6
# of this software and associated documentation files (the "Software"), to deal
7
# in the Software without restriction, including without limitation the rights
8
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
# copies of the Software, and to permit persons to whom the Software is
10
# furnished to do so, subject to the following conditions:
11
#
12
# The above copyright notice and this permission notice shall be included in
13
# all copies or substantial portions of the Software.
14
#
15
# Use of the Software is limited solely to applications:
16
# (a) running on a Xilinx device, or
17
# (b) that interact with a Xilinx device through a bus or interconnect.
18
#
19
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
# XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24
# OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
# SOFTWARE.
26
#
27
# Except as contained in this notice, the name of the Xilinx shall not be used
28
# in advertising or otherwise to promote the sale, use or other dealings in
29
# this Software without prior written authorization from Xilinx.
30
#
31
# MODIFICATION HISTORY:
32
# Ver      Who    Date     Changes
33
# -------- ------ -------- ------------------------------------
34
# 3.0      adk    12/10/13 Updated as per the New Tcl API's
35
##############################################################################
36
 
37
## @BEGIN_CHANGELOG EDK_I
38
##
39
##  - include header files
40
##
41
## @END_CHANGELOG
42
 
43
## @BEGIN_CHANGELOG EDK_H
44
##
45
##  - Added support for generation of multiple applications.
46
##    All TCL procedures are now required to have a software
47
##    project type as its first argument
48
##
49
## @END_CHANGELOG
50
 
51
# Uses $XILINX_EDK/bin/lib/xillib_sw.tcl
52
 
53
# -----------------------------------------------------------------
54
# Software Project Types (swproj):
55
#   0 : MemoryTest - Calls basic  memorytest routines from common driver dir
56
#   1 : PeripheralTest - Calls any existing polled_example and/or selftest
57
# -----------------------------------------------------------------
58
 
59
# -----------------------------------------------------------------
60
# TCL Procedures:
61
# -----------------------------------------------------------------
62
 
63
proc gen_include_files {swproj mhsinst} {
64
  if {$swproj == 0} {
65
    return ""
66
  }
67
  if {$swproj == 1} {
68
    set inc_file_lines {iic_header.h}
69
    return $inc_file_lines
70
  }
71
}
72
 
73
proc gen_src_files {swproj mhsinst} {
74
  if {$swproj == 0} {
75
    return ""
76
  }
77
  if {$swproj == 1} {
78
    set inc_file_lines {examples/xiic_selftest_example.c data/iic_header.h}
79
    return $inc_file_lines
80
  }
81
}
82
 
83
proc gen_testfunc_def {swproj mhsinst} {
84
  return ""
85
}
86
 
87
proc gen_init_code {swproj mhsinst} {
88
  return ""
89
}
90
 
91
proc gen_testfunc_call {swproj mhsinst} {
92
 
93
  if {$swproj == 0} {
94
    return ""
95
  }
96
 
97
  set ipname [get_property NAME $mhsinst]
98
  set deviceid [::hsi::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
99
   set stdout [get_property CONFIG.STDOUT [get_os]]
100
   if { $stdout == "" || $stdout == "none" } {
101
       set hasStdout 0
102
   } else {
103
       set hasStdout 1
104
   }
105
 
106
  set testfunc_call ""
107
 
108
  if {${hasStdout} == 0} {
109
 
110
      append testfunc_call "
111
 
112
   {
113
      int status;
114
 
115
      status = IicSelfTestExample(${deviceid});
116
 
117
   }"
118
  } else {
119
 
120
      append testfunc_call "
121
 
122
   {
123
      int status;
124
 
125
 
126
      print(\"\\r\\n Running IicSelfTestExample() for ${ipname}...\\r\\n\");
127
 
128
      status = IicSelfTestExample(${deviceid});
129
 
130
      if (status == 0) {
131
         print(\"IicSelfTestExample PASSED\\r\\n\");
132
      }
133
      else {
134
         print(\"IicSelfTestExample FAILED\\r\\n\");
135
      }
136
   }"
137
  }
138
 
139
  return $testfunc_call
140
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.