在好例子网,分享、交流、成长!
您当前所在位置:首页C/C++ 开发实例Linux内核编程 → IEEE Std 1666-2011(SystemC)

IEEE Std 1666-2011(SystemC)

Linux内核编程

下载此实例
  • 开发语言:C/C++
  • 实例大小:4.44M
  • 下载次数:6
  • 浏览次数:43
  • 发布时间:2023-01-28
  • 实例类别:Linux内核编程
  • 发 布 人:gonghiker
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: systemC system STEM IEEE 2011

实例介绍

【实例简介】IEEE Std 1666-2011(SystemC)

【实例截图】

【核心代码】

Contents
1. Overview.............................................................................................................................................. 1
1.1 Scope............................................................................................................................................ 1
1.2 Purpose......................................................................................................................................... 1
1.3 Subsets......................................................................................................................................... 2
1.4 Relationship with C ................................................................................................................. 2
1.5 Guidance for readers.................................................................................................................... 2
2. Normative references........................................................................................................................... 4
3. Terminology and conventions used in this standard............................................................................ 5
3.1 Terminology................................................................................................................................. 5
3.1.1 Shall, should, may, can.................................................................................................... 5
3.1.2 Implementation, application ............................................................................................ 5
3.1.3 Call, called from, derived from........................................................................................ 5
3.1.4 Specific technical terms................................................................................................... 5
3.2 Syntactical conventions ............................................................................................................... 7
3.2.1 Implementation-defined................................................................................................... 7
3.2.2 Disabled........................................................................................................................... 7
3.2.3 Ellipsis (...)....................................................................................................................... 7
3.2.4 Class names...................................................................................................................... 7
3.2.5 Embolded text.................................................................................................................. 8
3.3 Semantic conventions.................................................................................................................. 8
3.3.1 Class definitions and the inheritance hierarchy............................................................... 8
3.3.2 Function definitions and side-effects............................................................................... 8
3.3.3 Functions whose return type is a reference or a pointer.................................................. 8
3.3.4 Namespaces and internal naming .................................................................................. 10
3.3.5 Non-compliant applications and errors.......................................................................... 11
3.4 Notes and examples................................................................................................................... 11
4. Elaboration and simulation semantics ............................................................................................... 12
4.1 Elaboration................................................................................................................................. 12
4.1.1 Instantiation ................................................................................................................... 12
4.1.2 Process macros............................................................................................................... 14
4.1.3 Port binding and export binding .................................................................................... 14
4.1.4 Setting the time resolution............................................................................................. 15
4.2 Simulation.................................................................................................................................. 15
4.2.1 The scheduling algorithm .............................................................................................. 16
4.2.2 Initialization, cycles, and pauses in the scheduling algorithm....................................... 19
4.3 Running elaboration and simulation.......................................................................................... 20
4.3.1 Function declarations..................................................................................................... 20
4.3.2 Function sc_elab_and_sim............................................................................................. 20
4.3.3 Functions sc_argc and sc_argv...................................................................................... 21
4.3.4 Running under application control using functions sc_main and sc_start..................... 21
4.3.5 Running under control of the kernel.............................................................................. 23
4.4 Elaboration and simulation callbacks........................................................................................ 23
4.4.1 before_end_of_elaboration............................................................................................ 24
4.4.2 end_of_elaboration ........................................................................................................ 25
4.4.3 start_of_simulation ........................................................................................................ 26
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
ix
Copyright © 2012 IEEE. All rights reserved.
4.4.4 end_of_simulation ......................................................................................................... 27
4.5 Other functions related to the scheduler.................................................................................... 27
4.5.1 Function declarations..................................................................................................... 27
4.5.2 Function sc_pause.......................................................................................................... 28
4.5.3 Function sc_stop, sc_set_stop_mode, and sc_get_stop_mode ...................................... 29
4.5.4 Function sc_time_stamp................................................................................................ 30
4.5.5 Function sc_delta_count................................................................................................ 31
4.5.6 Function sc_is_running.................................................................................................. 31
4.5.7 Functions to detect pending activity.............................................................................. 31
4.5.8 Function sc_get_status................................................................................................... 32
5. Core language class definitions ......................................................................................................... 35
5.1 Class header files....................................................................................................................... 35
5.1.1 #include "systemc"......................................................................................................... 35
5.1.2 #include "systemc.h"...................................................................................................... 35
5.2 sc_module.................................................................................................................................. 37
5.2.1 Description..................................................................................................................... 37
5.2.2 Class definition.............................................................................................................. 37
5.2.3 Constraints on usage...................................................................................................... 39
5.2.4 kind ................................................................................................................................ 39
5.2.5 SC_MODULE ............................................................................................................... 40
5.2.6 Constructors................................................................................................................... 40
5.2.7 SC_CTOR...................................................................................................................... 40
5.2.8 SC_HAS_PROCESS..................................................................................................... 41
5.2.9 SC_METHOD, SC_THREAD, SC_CTHREAD........................................................... 42
5.2.10 Method process.............................................................................................................. 43
5.2.11 Thread and clocked thread processes............................................................................. 43
5.2.12 Clocked thread processes............................................................................................... 44
5.2.13 reset_signal_is and async_reset_signal_is..................................................................... 46
5.2.14 sensitive ......................................................................................................................... 48
5.2.15 dont_initialize ................................................................................................................ 48
5.2.16 set_stack_size................................................................................................................. 49
5.2.17 next_trigger.................................................................................................................... 50
5.2.18 wait................................................................................................................................. 52
5.2.19 Positional port binding................................................................................................... 53
5.2.20 before_end_of_elaboration, end_of_elaboration, start_of_simulation,
end_of_simulation ......................................................................................................... 55
5.2.21 get_child_objects and get_child_events ........................................................................ 55
5.2.22 sc_gen_unique_name..................................................................................................... 56
5.2.23 sc_behavior and sc_channel........................................................................................... 56
5.3 sc_module_name ....................................................................................................................... 57
5.3.1 Description..................................................................................................................... 57
5.3.2 Class definition.............................................................................................................. 57
5.3.3 Constraints on usage...................................................................................................... 58
5.3.4 Module hierarchy........................................................................................................... 58
5.3.5 Member functions.......................................................................................................... 58
5.4 sc_sensitive† .............................................................................................................................. 60
5.4.1 Description..................................................................................................................... 60
5.4.2 Class definition.............................................................................................................. 60
5.4.3 Constraints on usage...................................................................................................... 60
5.4.4 operator<<...................................................................................................................... 60
5.5 sc_spawn_options and sc_spawn............................................................................................... 61
5.5.1 Description..................................................................................................................... 61
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
x
Copyright © 2012 IEEE. All rights reserved.
5.5.2 Class definition.............................................................................................................. 61
5.5.3 Constraints on usage...................................................................................................... 62
5.5.4 Constructors................................................................................................................... 62
5.5.5 Member functions.......................................................................................................... 63
5.5.6 sc_spawn........................................................................................................................ 64
5.5.7 SC_FORK and SC_JOIN............................................................................................... 66
5.6 sc_process_handle ..................................................................................................................... 67
5.6.1 Description..................................................................................................................... 67
5.6.2 Class definition.............................................................................................................. 68
5.6.3 Constraints on usage...................................................................................................... 69
5.6.4 Constructors................................................................................................................... 69
5.6.5 Member functions.......................................................................................................... 69
5.6.6 Member functions for process control........................................................................... 73
5.6.7 sc_get_current_process_handle..................................................................................... 88
5.6.8 sc_is_unwinding ............................................................................................................ 89
5.7 sc_event_finder and sc_event_finder_t ..................................................................................... 90
5.7.1 Description..................................................................................................................... 90
5.7.2 Class definition.............................................................................................................. 90
5.7.3 Constraints on usage...................................................................................................... 90
5.8 sc_event_and_list and sc_event_or_list..................................................................................... 92
5.8.1 Description..................................................................................................................... 92
5.8.2 Class definition.............................................................................................................. 92
5.8.3 Constraints and usage .................................................................................................... 93
5.8.4 Constructors, destructor, assignment............................................................................. 93
5.8.5 Member functions and operators ................................................................................... 94
5.9 sc_event_and_expr† and sc_event_or_expr†............................................................................ 95
5.9.1 Description..................................................................................................................... 95
5.9.2 Class definition.............................................................................................................. 95
5.9.3 Constraints on usage...................................................................................................... 96
5.9.4 Operators........................................................................................................................ 96
5.10 sc_event ..................................................................................................................................... 97
5.10.1 Description..................................................................................................................... 97
5.10.2 Class definition.............................................................................................................. 97
5.10.3 Constraints on usage...................................................................................................... 98
5.10.4 Constructors, destructor, and event naming.................................................................. 98
5.10.5 Functions for naming and hierarchy traversal .............................................................. 99
5.10.6 notify and cancel.......................................................................................................... 100
5.10.7 Event lists..................................................................................................................... 101
5.10.8 Multiple event notifications......................................................................................... 101
5.11 sc_time..................................................................................................................................... 101
5.11.1 Description................................................................................................................... 101
5.11.2 Class definition............................................................................................................ 101
5.11.3 Time resolution............................................................................................................ 102
5.11.4 Function sc_max_time................................................................................................. 103
5.11.5 Functions and operators............................................................................................... 103
5.11.6 SC_ZERO_TIME ........................................................................................................ 103
5.12 sc_port...................................................................................................................................... 104
5.12.1 Description................................................................................................................... 104
5.12.2 Class definition............................................................................................................ 104
5.12.3 Template parameters.................................................................................................... 105
5.12.4 Constraints on usage.................................................................................................... 106
5.12.5 Constructors................................................................................................................. 107
5.12.6 kind .............................................................................................................................. 107
5.12.7 Named port binding..................................................................................................... 108
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xi
Copyright © 2012 IEEE. All rights reserved.
5.12.8 Member functions for bound ports and port-to-port binding....................................... 109
5.12.9 before_end_of_elaboration, end_of_elaboration, start_of_simulation,
end_of_simulation ....................................................................................................... 112
5.13 sc_export.................................................................................................................................. 113
5.13.1 Description................................................................................................................... 113
5.13.2 Class definition............................................................................................................ 113
5.13.3 Template parameters.................................................................................................... 114
5.13.4 Constraints on usage.................................................................................................... 114
5.13.5 Constructors................................................................................................................. 114
5.13.6 kind .............................................................................................................................. 114
5.13.7 Export binding ............................................................................................................. 115
5.13.8 Member functions for bound exports and export-to-export binding ........................... 116
5.13.9 before_end_of_elaboration, end_of_elaboration, start_of_simulation,
end_of_simulation ....................................................................................................... 117
5.14 sc_interface.............................................................................................................................. 117
5.14.1 Description................................................................................................................... 117
5.14.2 Class definition............................................................................................................ 117
5.14.3 Constraints on usage.................................................................................................... 118
5.14.4 register_port................................................................................................................. 118
5.14.5 default_event................................................................................................................ 119
5.15 sc_prim_channel...................................................................................................................... 119
5.15.1 Description................................................................................................................... 119
5.15.2 Class definition............................................................................................................ 119
5.15.3 Constraints on usage.................................................................................................... 121
5.15.4 Constructors, destructor, and hierarchical names........................................................ 121
5.15.5 kind .............................................................................................................................. 121
5.15.6 request_update and update........................................................................................... 121
5.15.7 next_trigger and wait................................................................................................... 123
5.15.8 before_end_of_elaboration, end_of_elaboration, start_of_simulation,
end_of_simulation ....................................................................................................... 123
5.16 sc_object .................................................................................................................................. 124
5.16.1 Description................................................................................................................... 124
5.16.2 Class definition............................................................................................................ 124
5.16.3 Constraints on usage.................................................................................................... 125
5.16.4 Constructors and destructor......................................................................................... 126
5.16.5 name, basename, and kind........................................................................................... 126
5.16.6 print and dump............................................................................................................. 127
5.16.7 Functions for object hierarchy traversal ...................................................................... 127
5.16.8 Member functions for attributes .................................................................................. 129
5.17 Hierarachical naming of objects and events............................................................................ 130
5.18 sc_attr_base.............................................................................................................................. 131
5.18.1 Description................................................................................................................... 131
5.18.2 Class definition............................................................................................................ 131
5.18.3 Member functions........................................................................................................ 132
5.19 sc_attribute............................................................................................................................... 132
5.19.1 Description................................................................................................................... 132
5.19.2 Class definition............................................................................................................ 132
5.19.3 Template parameters.................................................................................................... 132
5.19.4 Member functions and data members.......................................................................... 132
5.20 sc_attr_cltn............................................................................................................................... 133
5.20.1 Description................................................................................................................... 133
5.20.2 Class definition............................................................................................................ 133
5.20.3 Constraints on usage.................................................................................................... 133
5.20.4 Iterators........................................................................................................................ 133
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xii
Copyright © 2012 IEEE. All rights reserved.
6. Predefined channel class definitions................................................................................................ 135
6.1 sc_signal_in_if......................................................................................................................... 135
6.1.1 Description................................................................................................................... 135
6.1.2 Class definition............................................................................................................ 135
6.1.3 Member functions........................................................................................................ 135
6.2 sc_signal_in_if<bool> and sc_signal_in_if<sc_dt::sc_logic>................................................. 136
6.2.1 Description................................................................................................................... 136
6.2.2 Class definition............................................................................................................ 136
6.2.3 Member functions........................................................................................................ 137
6.3 sc_signal_inout_if.................................................................................................................... 137
6.3.1 Description................................................................................................................... 137
6.3.2 Class definition............................................................................................................ 137
6.3.3 Member functions........................................................................................................ 138
6.4 sc_signal................................................................................................................................... 139
6.4.1 Description................................................................................................................... 139
6.4.2 Class definition............................................................................................................ 139
6.4.3 Template parameter T.................................................................................................. 140
6.4.4 Reading and writing signals......................................................................................... 140
6.4.5 Constructors................................................................................................................. 141
6.4.6 register_port................................................................................................................. 141
6.4.7 Member functions for reading ..................................................................................... 141
6.4.8 Member functions for writing...................................................................................... 142
6.4.9 Member functions for events....................................................................................... 142
6.4.10 Diagnostic member functions...................................................................................... 143
6.4.11 operator<<.................................................................................................................... 143
6.5 sc_signal<bool,WRITER_POLICY> and sc_signal<sc_dt::sc_logic,WRITER_POLICY>.. 144
6.5.1 Description................................................................................................................... 144
6.5.2 Class definition............................................................................................................ 144
6.5.3 Member functions........................................................................................................ 146
6.6 sc_buffer .................................................................................................................................. 147
6.6.1 Description................................................................................................................... 147
6.6.2 Class definition............................................................................................................ 147
6.6.3 Constructors................................................................................................................. 147
6.6.4 Member functions........................................................................................................ 148
6.7 sc_clock ................................................................................................................................... 149
6.7.1 Description................................................................................................................... 149
6.7.2 Class definition............................................................................................................ 149
6.7.3 Characteristic properties.............................................................................................. 150
6.7.4 Constructors................................................................................................................. 150
6.7.5 write............................................................................................................................. 151
6.7.6 Diagnostic member functions...................................................................................... 151
6.7.7 before_end_of_elaboration.......................................................................................... 151
6.7.8 sc_in_clk...................................................................................................................... 151
6.8 sc_in......................................................................................................................................... 152
6.8.1 Description................................................................................................................... 152
6.8.2 Class definition............................................................................................................ 152
6.8.3 Member functions........................................................................................................ 153
6.8.4 Function sc_trace......................................................................................................... 153
6.8.5 end_of_elaboration ...................................................................................................... 153
6.9 sc_in<bool> and sc_in<sc_dt::sc_logic>................................................................................. 153
6.9.1 Description................................................................................................................... 153
6.9.2 Class definition............................................................................................................ 154
6.9.3 Member functions........................................................................................................ 155
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xiii
Copyright © 2012 IEEE. All rights reserved.
6.10 sc_inout.................................................................................................................................... 156
6.10.1 Description................................................................................................................... 156
6.10.2 Class definition............................................................................................................ 156
6.10.3 Member functions........................................................................................................ 157
6.10.4 initialize ....................................................................................................................... 157
6.10.5 Function sc_trace......................................................................................................... 157
6.10.6 end_of_elaboration ...................................................................................................... 158
6.10.7 Binding......................................................................................................................... 158
6.11 sc_inout<bool> and sc_inout<sc_dt::sc_logic> ...................................................................... 158
6.11.1 Description................................................................................................................... 158
6.11.2 Class definition............................................................................................................ 158
6.11.3 Member functions........................................................................................................ 160
6.12 sc_out....................................................................................................................................... 160
6.12.1 Description................................................................................................................... 160
6.12.2 Class definition............................................................................................................ 160
6.12.3 Member functions........................................................................................................ 161
6.13 sc_signal_resolved................................................................................................................... 161
6.13.1 Description................................................................................................................... 161
6.13.2 Class definition............................................................................................................ 161
6.13.3 Constructors................................................................................................................. 162
6.13.4 Resolution semantics ................................................................................................... 162
6.13.5 Member functions........................................................................................................ 163
6.14 sc_in_resolved ......................................................................................................................... 164
6.14.1 Description................................................................................................................... 164
6.14.2 Class definition............................................................................................................ 164
6.14.3 Member functions........................................................................................................ 165
6.15 sc_inout_resolved .................................................................................................................... 165
6.15.1 Description................................................................................................................... 165
6.15.2 Class definition............................................................................................................ 165
6.15.3 Member functions........................................................................................................ 166
6.16 sc_out_resolved ....................................................................................................................... 166
6.16.1 Description................................................................................................................... 166
6.16.2 Class definition............................................................................................................ 166
6.16.3 Member functions........................................................................................................ 167
6.17 sc_signal_rv............................................................................................................................. 167
6.17.1 Description................................................................................................................... 167
6.17.2 Class definition............................................................................................................ 167
6.17.3 Semantics and member functions................................................................................ 167
6.18 sc_in_rv.................................................................................................................................... 168
6.18.1 Description................................................................................................................... 168
6.18.2 Class definition............................................................................................................ 168
6.18.3 Member functions........................................................................................................ 169
6.19 sc_inout_rv............................................................................................................................... 169
6.19.1 Description................................................................................................................... 169
6.19.2 Class definition............................................................................................................ 169
6.19.3 Member functions........................................................................................................ 170
6.20 sc_out_rv.................................................................................................................................. 170
6.20.1 Description................................................................................................................... 170
6.20.2 Class definition............................................................................................................ 170
6.20.3 Member functions........................................................................................................ 171
6.21 sc_fifo_in_if............................................................................................................................. 171
6.21.1 Description................................................................................................................... 171
6.21.2 Class definition............................................................................................................ 171
6.21.3 Member functions........................................................................................................ 172
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xiv
Copyright © 2012 IEEE. All rights reserved.
6.22 sc_fifo_out_if........................................................................................................................... 172
6.22.1 Description................................................................................................................... 172
6.22.2 Class definition............................................................................................................ 172
6.22.3 Member functions........................................................................................................ 173
6.23 sc_fifo ...................................................................................................................................... 173
6.23.1 Description................................................................................................................... 173
6.23.2 Class definition............................................................................................................ 173
6.23.3 Template parameter T.................................................................................................. 174
6.23.4 Constructors................................................................................................................. 175
6.23.5 register_port................................................................................................................. 175
6.23.6 Member functions for reading ..................................................................................... 175
6.23.7 Member functions for writing...................................................................................... 176
6.23.8 The update phase ......................................................................................................... 176
6.23.9 Member functions for events....................................................................................... 177
6.23.10Member functions for available values and free slots ................................................. 177
6.23.11Diagnostic member functions...................................................................................... 177
6.23.12operator<<.................................................................................................................... 177
6.24 sc_fifo_in................................................................................................................................. 178
6.24.1 Description................................................................................................................... 178
6.24.2 Class definition............................................................................................................ 178
6.24.3 Member functions........................................................................................................ 179
6.25 sc_fifo_out............................................................................................................................... 179
6.25.1 Description................................................................................................................... 179
6.25.2 Class definition............................................................................................................ 179
6.25.3 Member functions........................................................................................................ 180
6.26 sc_mutex_if.............................................................................................................................. 182
6.26.1 Description................................................................................................................... 182
6.26.2 Class definition............................................................................................................ 182
6.26.3 Member functions........................................................................................................ 182
6.27 sc_mutex.................................................................................................................................. 182
6.27.1 Description................................................................................................................... 182
6.27.2 Class definition............................................................................................................ 182
6.27.3 Constructors................................................................................................................. 183
6.27.4 Member functions........................................................................................................ 183
6.28 sc_semaphore_if ...................................................................................................................... 184
6.28.1 Description................................................................................................................... 184
6.28.2 Class definition............................................................................................................ 184
6.28.3 Member functions........................................................................................................ 184
6.29 sc_semaphore........................................................................................................................... 185
6.29.1 Description................................................................................................................... 185
6.29.2 Class definition............................................................................................................ 185
6.29.3 Constructors................................................................................................................. 185
6.29.4 Member functions........................................................................................................ 185
6.30 sc_event_queue........................................................................................................................ 186
6.30.1 Description................................................................................................................... 186
6.30.2 Class definition............................................................................................................ 186
6.30.3 Constraints on usage.................................................................................................... 187
6.30.4 Constructors................................................................................................................. 187
6.30.5 kind .............................................................................................................................. 187
6.30.6 Member functions........................................................................................................ 187
7. SystemC data types.......................................................................................................................... 189
7.1 Introduction.............................................................................................................................. 189
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xv
Copyright © 2012 IEEE. All rights reserved.
7.2 Common characteristics........................................................................................................... 191
7.2.1 Initialization and assignment operators ....................................................................... 192
7.2.2 Precision of arithmetic expressions ............................................................................. 193
7.2.3 Base class default word length..................................................................................... 193
7.2.4 Word length ................................................................................................................. 194
7.2.5 Bit-select...................................................................................................................... 194
7.2.6 Part-select..................................................................................................................... 195
7.2.7 Concatenation .............................................................................................................. 196
7.2.8 Reduction operators..................................................................................................... 197
7.2.9 Integer conversion........................................................................................................ 198
7.2.10 String input and output ................................................................................................ 198
7.2.11 Conversion of application-defined types in integer expressions................................. 199
7.3 String literals............................................................................................................................ 199
7.4 sc_value_base†........................................................................................................................ 201
7.4.1 Description................................................................................................................... 201
7.4.2 Class definition............................................................................................................ 201
7.4.3 Constraints on usage.................................................................................................... 201
7.4.4 Member functions........................................................................................................ 202
7.5 Limited-precision integer types............................................................................................... 202
7.5.1 Type definitions........................................................................................................... 202
7.5.2 sc_int_base................................................................................................................... 203
7.5.3 sc_uint_base................................................................................................................. 208
7.5.4 sc_int............................................................................................................................ 213
7.5.5 sc_uint.......................................................................................................................... 215
7.5.6 Bit-selects..................................................................................................................... 217
7.5.7 Part-selects................................................................................................................... 222
7.6 Finite-precision integer types................................................................................................... 227
7.6.1 Type definitions........................................................................................................... 227
7.6.2 Constraints on usage.................................................................................................... 227
7.6.3 sc_signed...................................................................................................................... 227
7.6.4 sc_unsigned.................................................................................................................. 234
7.6.5 sc_bigint....................................................................................................................... 240
7.6.6 sc_biguint..................................................................................................................... 242
7.6.7 Bit-selects..................................................................................................................... 244
7.6.8 Part-selects................................................................................................................... 248
7.7 Integer concatenations ............................................................................................................. 253
7.7.1 Description................................................................................................................... 253
7.7.2 Class definition............................................................................................................ 253
7.7.3 Constraints on usage.................................................................................................... 255
7.7.4 Assignment operators .................................................................................................. 255
7.7.5 Implicit type conversion .............................................................................................. 255
7.7.6 Explicit type conversion .............................................................................................. 255
7.7.7 Other member functions .............................................................................................. 256
7.8 Generic base proxy class.......................................................................................................... 256
7.8.1 Description................................................................................................................... 256
7.8.2 Class definition............................................................................................................ 256
7.8.3 Constraints on usage.................................................................................................... 256
7.9 Logic and vector types............................................................................................................. 257
7.9.1 Type definitions........................................................................................................... 257
7.9.2 sc_logic........................................................................................................................ 257
7.9.3 sc_bv_base................................................................................................................... 262
7.9.4 sc_lv_base.................................................................................................................... 267
7.9.5 sc_bv............................................................................................................................ 273
7.9.6 sc_lv............................................................................................................................. 275
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xvi
Copyright © 2012 IEEE. All rights reserved.
7.9.7 Bit-selects..................................................................................................................... 277
7.9.8 Part-selects................................................................................................................... 280
7.9.9 Concatenations............................................................................................................. 286
7.10 Fixed-point types ..................................................................................................................... 293
7.10.1 Fixed-point representation........................................................................................... 293
7.10.2 Fixed-point type conversion ........................................................................................ 294
7.10.3 Fixed-point data types.................................................................................................. 295
7.10.4 Fixed-point expressions and operations....................................................................... 296
7.10.5 Bit and part selection ................................................................................................... 299
7.10.6 Variable-precision fixed-point value limits................................................................. 300
7.10.7 Fixed-point word length and mode.............................................................................. 300
7.10.8 Conversions to character string.................................................................................... 302
7.10.9 Finite word-length effects............................................................................................ 304
7.10.10sc_fxnum...................................................................................................................... 327
7.10.11sc_fxnum_fast.............................................................................................................. 332
7.10.12sc_fxval........................................................................................................................ 337
7.10.13sc_fxval_fast................................................................................................................ 341
7.10.14sc_fix............................................................................................................................ 346
7.10.15sc_ufix.......................................................................................................................... 349
7.10.16sc_fix_fast.................................................................................................................... 352
7.10.17sc_ufix_fast.................................................................................................................. 355
7.10.18sc_fixed........................................................................................................................ 358
7.10.19sc_ufixed...................................................................................................................... 360
7.10.20sc_fixed_fast................................................................................................................ 362
7.10.21sc_ufixed_fast.............................................................................................................. 365
7.10.22Bit-selects..................................................................................................................... 367
7.10.23Part-selects................................................................................................................... 369
7.11 Contexts................................................................................................................................... 375
7.11.1 sc_length_param.......................................................................................................... 375
7.11.2 sc_length_context ........................................................................................................ 377
7.11.3 sc_fxtype_params ........................................................................................................ 378
7.11.4 sc_fxtype_context........................................................................................................ 380
7.11.5 sc_fxcast_switch.......................................................................................................... 381
7.11.6 sc_fxcast_context......................................................................................................... 382
7.12 Control of string representation............................................................................................... 383
7.12.1 Description................................................................................................................... 383
7.12.2 Class definition............................................................................................................ 383
7.12.3 Functions...................................................................................................................... 384
8. SystemC utilities.............................................................................................................................. 385
8.1 Trace files ................................................................................................................................ 385
8.1.1 Class definition and function declarations................................................................... 385
8.1.2 sc_trace_file................................................................................................................. 385
8.1.3 sc_create_vcd_trace_file.............................................................................................. 386
8.1.4 sc_close_vcd_trace_file............................................................................................... 386
8.1.5 sc_write_comment....................................................................................................... 386
8.1.6 sc_trace ........................................................................................................................ 386
8.2 sc_report................................................................................................................................... 388
8.2.1 Description................................................................................................................... 388
8.2.2 Class definition............................................................................................................ 388
8.2.3 Constraints on usage.................................................................................................... 389
8.2.4 sc_verbosity................................................................................................................. 389
8.2.5 sc_severity ................................................................................................................... 389
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xvii
Copyright © 2012 IEEE. All rights reserved.
8.2.6 Copy constructor and assignment................................................................................ 390
8.2.7 Member functions........................................................................................................ 390
8.3 sc_report_handler..................................................................................................................... 391
8.3.1 Description................................................................................................................... 391
8.3.2 Class definition............................................................................................................ 391
8.3.3 Constraints on usage.................................................................................................... 393
8.3.4 sc_actions..................................................................................................................... 393
8.3.5 report............................................................................................................................ 393
8.3.6 set_actions.................................................................................................................... 394
8.3.7 stop_after ..................................................................................................................... 395
8.3.8 get_count...................................................................................................................... 396
8.3.9 Verbosity level............................................................................................................. 396
8.3.10 suppress and force........................................................................................................ 396
8.3.11 set_handler................................................................................................................... 397
8.3.12 get_new_action_id....................................................................................................... 398
8.3.13 sc_interrupt_here and sc_stop_here............................................................................. 398
8.3.14 get_cached_report and clear_cached_report................................................................ 398
8.3.15 set_log_file_name and get_log_file_name.................................................................. 399
8.4 sc_exception............................................................................................................................. 399
8.4.1 Description................................................................................................................... 399
8.4.2 Class definition............................................................................................................ 399
8.5 sc_vector.................................................................................................................................. 400
8.5.1 Description................................................................................................................... 400
8.5.2 Class definition............................................................................................................ 400
8.5.3 Constraints on usage.................................................................................................... 403
8.5.4 Constructors and destructors........................................................................................ 403
8.5.5 init and create_element................................................................................................ 404
8.5.6 kind, size, get_elements............................................................................................... 405
8.5.7 operator[] and at........................................................................................................... 406
8.5.8 Iterators........................................................................................................................ 406
8.5.9 bind .............................................................................................................................. 406
8.5.10 sc_assemble_vector ..................................................................................................... 408
8.6 Utility functions....................................................................................................................... 410
8.6.1 Function declarations................................................................................................... 410
8.6.2 sc_abs........................................................................................................................... 411
8.6.3 sc_max......................................................................................................................... 411
8.6.4 sc_min.......................................................................................................................... 411
8.6.5 Version and copyright.................................................................................................. 411
9. Overview of TLM-2.0...................................................................................................................... 413
9.1 Compliance with the TLM-2.0 standard.................................................................................. 414
10. Introduction to TLM-2.0.................................................................................................................. 415
10.1 Background.............................................................................................................................. 415
10.2 Transaction-level modeling, use cases, and abstraction.......................................................... 415
10.3 Coding styles............................................................................................................................ 416
10.3.1 Untimed coding style................................................................................................... 416
10.3.2 Loosely-timed coding style and temporal decoupling................................................. 417
10.3.3 Synchronization in loosely-timed models.................................................................... 418
10.3.4 Approximately-timed coding style .............................................................................. 418
10.3.5 Characterization of loosely-timed and approximately-timed coding styles ................ 419
10.3.6 Switching between loosely-timed and approximately-timed modeling ...................... 419
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xviii
Copyright © 2012 IEEE. All rights reserved.
10.3.7 Cycle-accurate modeling ............................................................................................. 419
10.3.8 Blocking versus non-blocking transport interfaces ..................................................... 419
10.3.9 Use cases and coding styles......................................................................................... 420
10.4 Initiators, targets, sockets, and transaction bridges ................................................................. 420
10.5 DMI and debug transport interfaces ........................................................................................ 423
10.6 Combined interfaces and sockets............................................................................................. 423
10.7 Namespaces ............................................................................................................................. 423
10.8 Header files and version numbers............................................................................................ 424
10.8.1 Software version information ...................................................................................... 424
10.8.2 Definitions ................................................................................................................... 424
10.8.3 Rules ............................................................................................................................ 425
11. TLM-2.0 core interfaces.................................................................................................................. 426
11.1 Transport interfaces ................................................................................................................. 426
11.1.1 Blocking transport interface......................................................................................... 426
11.1.2 Non-blocking transport interface................................................................................. 430
11.1.3 Timing annotation with the transport interfaces.......................................................... 438
11.1.4 Migration path from TLM-1........................................................................................ 442
11.2 Direct memory interface.......................................................................................................... 442
11.2.1 Introduction.................................................................................................................. 442
11.2.2 Class definition............................................................................................................ 443
11.2.3 get_direct_mem_ptr method........................................................................................ 444
11.2.4 template argument and tlm_generic_payload class..................................................... 445
11.2.5 tlm_dmi class............................................................................................................... 445
11.2.6 invalidate_direct_mem_ptr method............................................................................. 448
11.2.7 DMI versus transport................................................................................................... 449
11.2.8 DMI and temporal decoupling..................................................................................... 449
11.2.9 Optimization using a DMI hint.................................................................................... 450
11.3 Debug transport interface......................................................................................................... 450
11.3.1 Introduction.................................................................................................................. 450
11.3.2 Class definition............................................................................................................ 450
11.3.3 TRANS template argument and tlm_generic_payload class....................................... 451
11.3.4 Rules ............................................................................................................................ 451
12. TLM-2.0 global quantum................................................................................................................. 453
12.1 Introduction.............................................................................................................................. 453
12.2 Header file................................................................................................................................ 453
12.3 Class definition........................................................................................................................ 453
12.4 Class tlm_global_quantum ...................................................................................................... 454
13. Combined TLM-2.0 interfaces and sockets..................................................................................... 455
13.1 Combined interfaces................................................................................................................ 455
13.1.1 Introduction.................................................................................................................. 455
13.1.2 Class definition............................................................................................................ 455
13.2 Initiator and target sockets....................................................................................................... 456
13.2.1 Introduction.................................................................................................................. 456
13.2.2 Class definition............................................................................................................ 456
13.2.3 Classes tlm_base_initiator_socket_b and tlm_base_target_socket_b.......................... 460
13.2.4 Classes tlm_base_initiator_socket and tlm_base_target_socket.................................. 460
13.2.5 Classes tlm_initiator_socket and tlm_target_socket.................................................... 461
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xix
Copyright © 2012 IEEE. All rights reserved.
14. TLM-2.0 generic payload................................................................................................................ 465
14.1 Introduction.............................................................................................................................. 465
14.2 Extensions and interoperability ............................................................................................... 465
14.2.1 Use the generic payload directly, with ignorable extensions....................................... 466
14.2.2 Define a new protocol traits class containing a typedef for tlm_generic_payload...... 467
14.2.3 Define a new protocol traits class and a new transaction type .................................... 467
14.3 Generic payload attributes and methods.................................................................................. 467
14.4 Class definition........................................................................................................................ 468
14.5 Generic payload memory management ................................................................................... 470
14.6 Constructors, assignment, and destructor................................................................................ 474
14.7 Default values and modifiability of attributes ......................................................................... 474
14.8 Option attribute........................................................................................................................ 476
14.9 Command attribute .................................................................................................................. 477
14.10Address attribute..................................................................................................................... 478
14.11Data pointer attribute.............................................................................................................. 479
14.12Data length attribute................................................................................................................ 480
14.13Byte enable pointer attribute................................................................................................... 480
14.14Byte enable length attribute.................................................................................................... 481
14.15Streaming width attribute........................................................................................................ 482
14.16DMI allowed attribute............................................................................................................. 482
14.17Response status attribute......................................................................................................... 483
14.17.1The standard error response......................................................................................... 484
14.18Endianness.............................................................................................................................. 487
14.18.1Introduction.................................................................................................................. 487
14.18.2Rules ............................................................................................................................ 488
14.19Helper functions to determine host endianness ...................................................................... 490
14.19.1Introduction.................................................................................................................. 490
14.19.2Definition..................................................................................................................... 490
14.19.3Rules ............................................................................................................................ 491
14.20Helper functions for endianness conversion........................................................................... 491
14.20.1Introduction.................................................................................................................. 491
14.20.2Definition..................................................................................................................... 492
14.20.3Rules ............................................................................................................................ 492
14.21Generic payload extensions.................................................................................................... 494
14.21.1Introduction.................................................................................................................. 494
14.21.2Rationale...................................................................................................................... 494
14.21.3Extension pointers, objects and transaction bridges.................................................... 495
14.21.4Rules ............................................................................................................................ 495
15. TLM-2.0 base protocol and phases.................................................................................................. 500
15.1 Phases....................................................................................................................................... 500
15.1.1 Introduction.................................................................................................................. 500
15.1.2 Class definition............................................................................................................ 500
15.1.3 Rules ............................................................................................................................ 501
15.2 Base protocol ........................................................................................................................... 502
15.2.1 Introduction.................................................................................................................. 502
15.2.2 Class definition............................................................................................................ 503
15.2.3 Base protocol phase sequences.................................................................................... 503
15.2.4 Permitted phase transitions.......................................................................................... 505
15.2.5 Ignorable phases .......................................................................................................... 508
15.2.6 Base protocol timing parameters and flow control...................................................... 510
15.2.7 Base protocol rules concerning timing annotation ...................................................... 514
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xx
Copyright © 2012 IEEE. All rights reserved.
15.2.8 Base protocol rules concerning b_transport................................................................. 514
15.2.9 Base protocol rules concerning request and response ordering................................... 515
15.2.10Base protocol rules for switching between b_transport and nb_transport................... 516
15.2.11Other base protocol rules............................................................................................. 517
15.2.12Summary of base protocol transaction ordering rules................................................. 517
15.2.13Guidelines for creating base-protocol-compliant components.................................... 517
16. TLM-2.0 utilities.............................................................................................................................. 521
16.1 Convenience sockets................................................................................................................ 521
16.1.1 Introduction.................................................................................................................. 521
16.1.2 Simple sockets ............................................................................................................. 523
16.1.3 Tagged simple sockets................................................................................................. 529
16.1.4 Multi-sockets ............................................................................................................... 532
16.2 Quantum keeper....................................................................................................................... 537
16.2.1 Introduction.................................................................................................................. 537
16.2.2 Header file.................................................................................................................... 537
16.2.3 Class definition............................................................................................................ 537
16.2.4 General guidelines for processes using temporal decoupling...................................... 538
16.2.5 Class tlm_quantumkeeper............................................................................................ 539
16.3 Payload event queue ................................................................................................................ 541
16.3.1 Introduction.................................................................................................................. 541
16.3.2 Header file.................................................................................................................... 542
16.3.3 Class definition............................................................................................................ 542
16.3.4 Rules ............................................................................................................................ 543
16.4 Instance-specific extensions .................................................................................................... 544
16.4.1 Introduction.................................................................................................................. 544
16.4.2 Header file.................................................................................................................... 544
16.4.3 Class definition............................................................................................................ 544
17. TLM-1 Message passing interface and analysis ports..................................................................... 546
17.1 Put, get, peek, and transport interfaces.................................................................................... 546
17.1.1 Description................................................................................................................... 546
17.1.2 Class Definition ........................................................................................................... 546
17.1.3 Blocking versus non-blocking interfaces..................................................................... 548
17.1.4 Blocking put, get, peek, and transport......................................................................... 549
17.1.5 Non-blocking interface methods.................................................................................. 549
17.1.6 Argument passing and transaction lifetime ................................................................. 550
17.1.7 Constraints on the transaction data type...................................................................... 551
17.2 TLM-1 fifo interfaces .............................................................................................................. 551
17.2.1 Description................................................................................................................... 551
17.2.2 Class Definition ........................................................................................................... 551
17.2.3 Member functions........................................................................................................ 552
17.3 tlm_fifo .................................................................................................................................... 552
17.3.1 Description................................................................................................................... 552
17.3.2 Class Definition ........................................................................................................... 553
17.3.3 Template parameter T.................................................................................................. 554
17.3.4 Constructors and destructor......................................................................................... 554
17.3.5 Member functions........................................................................................................ 554
17.3.6 Delta cycle semantics................................................................................................... 556
17.4 Analysis interface and analysis ports....................................................................................... 558
17.4.1 Class definition............................................................................................................ 558
17.4.2 Rules ............................................................................................................................ 559
Authorized licensed use limited to: xinliang yu. Downloaded on December 13,2021 at 12:51:45 UTC from IEEE Xplore. Restrictions apply.
xxi
Copyright © 2012 IEEE. All rights reserved.
Annex A (informative) Introduction to SystemC........................................................................................ 562
Annex B (informative) Glossary.................................................................................................................. 566
Annex C (informative) Deprecated features................................................................................................ 583
Annex D (informative) Changes between IEEE Std 1666-2005 and IEEE Std 1666-2011........................ 585
Index ............................................................................................................................................................ 589

实例下载地址

IEEE Std 1666-2011(SystemC)

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警