1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 15 implied. See the License for the specific language governing 16 permissions and limitations under the License. 17 18 *****************************************************************************/ 19 20/***************************************************************************** 21 22 sc_fixed.h - 23 24 Original Author: Martin Janssen, Synopsys, Inc. 25 26 *****************************************************************************/ 27 28/***************************************************************************** 29 30 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 31 changes you are making here. 32 33 Name, Affiliation, Date: 34 Description of Modification: 35 36 *****************************************************************************/ 37 38// $Log: sc_fixed.h,v $ 39// Revision 1.2 2011/01/19 18:57:40 acg 40// Andy Goodrich: changes for IEEE_1666_2011. 41// 42// Revision 1.1.1.1 2006/12/15 20:20:04 acg 43// SystemC 2.3 44// 45// Revision 1.3 2006/01/13 18:53:57 acg 46// Andy Goodrich: added $Log command so that CVS comments are reproduced in 47// the source. 48// 49 50#ifndef __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__ 51#define __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__ 52 53#include "sc_fix.hh" 54 55namespace sc_dt 56{ 57 58// classes defined in this module 59template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 60class sc_fixed; 61template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 62class sc_fixed_fast; 63 64// ---------------------------------------------------------------------------- 65// TEMPLATE CLASS : sc_fixed 66// 67// "Constrained" signed fixed-point class; arbitrary precision. 68// ---------------------------------------------------------------------------- 69 70template <int W, int I, 71 sc_q_mode Q=SC_DEFAULT_Q_MODE_, 72 sc_o_mode O=SC_DEFAULT_O_MODE_, int N=SC_DEFAULT_N_BITS_> 73class sc_fixed : public sc_fix 74{ 75 public: 76 // constructors 77 explicit sc_fixed(sc_fxnum_observer * =0); 78 explicit sc_fixed(const sc_fxcast_switch &, sc_fxnum_observer * =0); 79 80#define DECL_CTORS_T_A(tp) \ 81 sc_fixed(tp, sc_fxnum_observer * =0); \ 82 sc_fixed(tp, const sc_fxcast_switch &, sc_fxnum_observer * =0); 83 84#define DECL_CTORS_T_B(tp) \ 85 explicit sc_fixed(tp, sc_fxnum_observer * =0); \ 86 sc_fixed(tp, const sc_fxcast_switch &, sc_fxnum_observer * =0); 87 88 DECL_CTORS_T_A(int) 89 DECL_CTORS_T_A(unsigned int) 90 DECL_CTORS_T_A(long) 91 DECL_CTORS_T_A(unsigned long) 92 DECL_CTORS_T_A(float) 93 DECL_CTORS_T_A(double) 94 DECL_CTORS_T_A(const char *) 95 DECL_CTORS_T_A(const sc_fxval &) 96 DECL_CTORS_T_A(const sc_fxval_fast &) 97 DECL_CTORS_T_A(const sc_fxnum &) 98 DECL_CTORS_T_A(const sc_fxnum_fast &) 99 100 DECL_CTORS_T_B(int64) 101 DECL_CTORS_T_B(uint64) 102 DECL_CTORS_T_B(const sc_int_base&) 103 DECL_CTORS_T_B(const sc_uint_base&) 104 DECL_CTORS_T_B(const sc_signed&) 105 DECL_CTORS_T_B(const sc_unsigned&) 106 107#undef DECL_CTORS_T_A 108#undef DECL_CTORS_T_B 109 110 // copy constructor 111 sc_fixed(const sc_fixed<W, I, Q, O, N> &); 112 113 // assignment operators 114 sc_fixed &operator = (const sc_fixed<W, I, Q, O, N> &); 115 116#define DECL_ASN_OP_T(op, tp) sc_fixed &operator op (tp); 117 118#define DECL_ASN_OP_OTHER(op) \ 119 DECL_ASN_OP_T(op, int64) \ 120 DECL_ASN_OP_T(op, uint64) \ 121 DECL_ASN_OP_T(op, const sc_int_base&) \ 122 DECL_ASN_OP_T(op, const sc_uint_base&) \ 123 DECL_ASN_OP_T(op, const sc_signed&) \ 124 DECL_ASN_OP_T(op, const sc_unsigned&) 125 126#define DECL_ASN_OP(op) \ 127 DECL_ASN_OP_T(op, int) \ 128 DECL_ASN_OP_T(op, unsigned int) \ 129 DECL_ASN_OP_T(op, long) \ 130 DECL_ASN_OP_T(op, unsigned long) \ 131 DECL_ASN_OP_T(op, float) \ 132 DECL_ASN_OP_T(op, double) \ 133 DECL_ASN_OP_T(op, const char *) \ 134 DECL_ASN_OP_T(op, const sc_fxval &) \ 135 DECL_ASN_OP_T(op, const sc_fxval_fast &) \ 136 DECL_ASN_OP_T(op, const sc_fxnum &) \ 137 DECL_ASN_OP_T(op, const sc_fxnum_fast &) \ 138 DECL_ASN_OP_OTHER(op) 139 140 DECL_ASN_OP(=) 141 142 DECL_ASN_OP(*=) 143 DECL_ASN_OP(/=) 144 DECL_ASN_OP(+=) 145 DECL_ASN_OP(-=) 146 147 DECL_ASN_OP_T(<<=, int) 148 DECL_ASN_OP_T(>>=, int) 149 150 DECL_ASN_OP_T(&=, const sc_fix &) 151 DECL_ASN_OP_T(&=, const sc_fix_fast &) 152 DECL_ASN_OP_T(|=, const sc_fix &) 153 DECL_ASN_OP_T(|=, const sc_fix_fast &) 154 DECL_ASN_OP_T(^=, const sc_fix &) 155 DECL_ASN_OP_T(^=, const sc_fix_fast &) 156 157#undef DECL_ASN_OP_T 158#undef DECL_ASN_OP_OTHER 159#undef DECL_ASN_OP 160 161 // auto-increment and auto-decrement 162 const sc_fxval operator ++ (int); 163 const sc_fxval operator -- (int); 164 165 sc_fixed & operator ++ (); 166 sc_fixed & operator -- (); 167}; 168 169 170// ---------------------------------------------------------------------------- 171// TEMPLATE CLASS : sc_fixed_fast 172// 173// "Constrained" signed fixed-point class; limited precision. 174// ---------------------------------------------------------------------------- 175 176template <int W, int I, 177 sc_q_mode Q=SC_DEFAULT_Q_MODE_, 178 sc_o_mode O=SC_DEFAULT_O_MODE_, int N=SC_DEFAULT_N_BITS_> 179class sc_fixed_fast : public sc_fix_fast 180{ 181 public: 182 // constructors 183 explicit sc_fixed_fast(sc_fxnum_fast_observer * =0); 184 explicit sc_fixed_fast(const sc_fxcast_switch &, 185 sc_fxnum_fast_observer * =0); 186 187#define DECL_CTORS_T_A(tp) \ 188 sc_fixed_fast(tp, sc_fxnum_fast_observer * =0); \ 189 sc_fixed_fast(tp, const sc_fxcast_switch &, \ 190 sc_fxnum_fast_observer * =0); 191 192#define DECL_CTORS_T_B(tp) \ 193 explicit sc_fixed_fast(tp, sc_fxnum_fast_observer * =0); \ 194 sc_fixed_fast(tp, const sc_fxcast_switch &, \ 195 sc_fxnum_fast_observer * =0); 196 197 DECL_CTORS_T_A(int) 198 DECL_CTORS_T_A(unsigned int) 199 DECL_CTORS_T_A(long) 200 DECL_CTORS_T_A(unsigned long) 201 DECL_CTORS_T_A(float) 202 DECL_CTORS_T_A(double) 203 DECL_CTORS_T_A(const char *) 204 DECL_CTORS_T_A(const sc_fxval &) 205 DECL_CTORS_T_A(const sc_fxval_fast &) 206 DECL_CTORS_T_A(const sc_fxnum &) 207 DECL_CTORS_T_A(const sc_fxnum_fast &) 208 209 DECL_CTORS_T_B(int64) 210 DECL_CTORS_T_B(uint64) 211 DECL_CTORS_T_B(const sc_int_base &) 212 DECL_CTORS_T_B(const sc_uint_base &) 213 DECL_CTORS_T_B(const sc_signed &) 214 DECL_CTORS_T_B(const sc_unsigned &) 215 216#undef DECL_CTORS_T_A 217#undef DECL_CTORS_T_B 218 219 // copy constructor 220 sc_fixed_fast(const sc_fixed_fast<W, I, Q, O, N> &); 221 222 // assignment operators 223 sc_fixed_fast &operator = (const sc_fixed_fast<W, I, Q, O, N> &); 224 225#define DECL_ASN_OP_T(op, tp) sc_fixed_fast &operator op (tp); 226 227#define DECL_ASN_OP_OTHER(op) \ 228 DECL_ASN_OP_T(op, int64) \ 229 DECL_ASN_OP_T(op, uint64) \ 230 DECL_ASN_OP_T(op, const sc_int_base &) \ 231 DECL_ASN_OP_T(op, const sc_uint_base &) \ 232 DECL_ASN_OP_T(op, const sc_signed &) \ 233 DECL_ASN_OP_T(op, const sc_unsigned &) 234 235#define DECL_ASN_OP(op) \ 236 DECL_ASN_OP_T(op, int) \ 237 DECL_ASN_OP_T(op, unsigned int) \ 238 DECL_ASN_OP_T(op, long) \ 239 DECL_ASN_OP_T(op, unsigned long) \ 240 DECL_ASN_OP_T(op, float) \ 241 DECL_ASN_OP_T(op, double) \ 242 DECL_ASN_OP_T(op, const char *) \ 243 DECL_ASN_OP_T(op, const sc_fxval &) \ 244 DECL_ASN_OP_T(op, const sc_fxval_fast &) \ 245 DECL_ASN_OP_T(op, const sc_fxnum &) \ 246 DECL_ASN_OP_T(op, const sc_fxnum_fast &) \ 247 DECL_ASN_OP_OTHER(op) 248 249 DECL_ASN_OP(=) 250 251 DECL_ASN_OP(*=) 252 DECL_ASN_OP(/=) 253 DECL_ASN_OP(+=) 254 DECL_ASN_OP(-=) 255 256 DECL_ASN_OP_T(<<=, int) 257 DECL_ASN_OP_T(>>=, int) 258 259 DECL_ASN_OP_T(&=, const sc_fix &) 260 DECL_ASN_OP_T(&=, const sc_fix_fast &) 261 DECL_ASN_OP_T(|=, const sc_fix &) 262 DECL_ASN_OP_T(|=, const sc_fix_fast &) 263 DECL_ASN_OP_T(^=, const sc_fix &) 264 DECL_ASN_OP_T(^=, const sc_fix_fast &) 265 266#undef DECL_ASN_OP_T 267#undef DECL_ASN_OP_OTHER 268#undef DECL_ASN_OP 269 270 // auto-increment and auto-decrement 271 const sc_fxval_fast operator ++ (int); 272 const sc_fxval_fast operator -- (int); 273 274 sc_fixed_fast& operator ++ (); 275 sc_fixed_fast& operator -- (); 276}; 277 278 279// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 280 281// ---------------------------------------------------------------------------- 282// TEMPLATE CLASS : sc_fixed 283// 284// "Constrained" signed fixed-point class; arbitrary precision. 285// ---------------------------------------------------------------------------- 286 287template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 288inline sc_fixed<W, I, Q, O, N>::sc_fixed(sc_fxnum_observer *observer_) : 289 sc_fix(W, I, Q, O, N, observer_) 290{} 291 292template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 293inline sc_fixed<W, I, Q, O, N>::sc_fixed( 294 const sc_fxcast_switch &cast_sw, sc_fxnum_observer *observer_) : 295 sc_fix(W, I, Q, O, N, cast_sw, observer_) 296{} 297 298#define DEFN_CTORS_T(tp) \ 299template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 300inline sc_fixed<W, I, Q, O, N>::sc_fixed( \ 301 tp a, sc_fxnum_observer* observer_) : \ 302 sc_fix(a, W, I, Q, O, N, observer_) \ 303{} \ 304 \ 305template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 306inline sc_fixed<W, I, Q, O, N>::sc_fixed( \ 307 tp a, const sc_fxcast_switch &cast_sw, \ 308 sc_fxnum_observer *observer_) : \ 309 sc_fix(a, W, I, Q, O, N, cast_sw, observer_) \ 310{} 311 312DEFN_CTORS_T(int) 313DEFN_CTORS_T(unsigned int) 314DEFN_CTORS_T(long) 315DEFN_CTORS_T(unsigned long) 316DEFN_CTORS_T(float) 317DEFN_CTORS_T(double) 318DEFN_CTORS_T(const char *) 319DEFN_CTORS_T(const sc_fxval &) 320DEFN_CTORS_T(const sc_fxval_fast &) 321DEFN_CTORS_T(const sc_fxnum &) 322DEFN_CTORS_T(const sc_fxnum_fast &) 323 324DEFN_CTORS_T(int64) 325DEFN_CTORS_T(uint64) 326DEFN_CTORS_T(const sc_int_base &) 327DEFN_CTORS_T(const sc_uint_base &) 328DEFN_CTORS_T(const sc_signed &) 329DEFN_CTORS_T(const sc_unsigned &) 330 331#undef DEFN_CTORS_T 332 333// copy constructor 334template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 335inline sc_fixed<W, I, Q, O, N>::sc_fixed(const sc_fixed<W, I, Q, O, N> &a) : 336 sc_fix(a, W, I, Q, O, N) 337{} 338 339// assignment operators 340template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 341inline sc_fixed<W, I, Q, O, N> & 342sc_fixed<W, I, Q, O, N>::operator = (const sc_fixed<W, I, Q, O, N> &a) 343{ 344 sc_fix::operator = (a); 345 return *this; 346} 347 348#define DEFN_ASN_OP_T(op, tp) \ 349template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 350inline sc_fixed<W, I, Q, O, N> & \ 351sc_fixed<W, I, Q, O, N>::operator op (tp a) \ 352{ \ 353 sc_fix::operator op (a); \ 354 return *this; \ 355} 356 357#define DEFN_ASN_OP_OTHER(op) \ 358DEFN_ASN_OP_T(op, int64) \ 359DEFN_ASN_OP_T(op, uint64) \ 360DEFN_ASN_OP_T(op, const sc_int_base &) \ 361DEFN_ASN_OP_T(op, const sc_uint_base &) \ 362DEFN_ASN_OP_T(op, const sc_signed &) \ 363DEFN_ASN_OP_T(op, const sc_unsigned &) 364 365#define DEFN_ASN_OP(op) \ 366DEFN_ASN_OP_T(op, int) \ 367DEFN_ASN_OP_T(op, unsigned int) \ 368DEFN_ASN_OP_T(op, long) \ 369DEFN_ASN_OP_T(op, unsigned long) \ 370DEFN_ASN_OP_T(op, float) \ 371DEFN_ASN_OP_T(op, double) \ 372DEFN_ASN_OP_T(op, const char *) \ 373DEFN_ASN_OP_T(op, const sc_fxval &) \ 374DEFN_ASN_OP_T(op, const sc_fxval_fast &) \ 375DEFN_ASN_OP_T(op, const sc_fxnum &) \ 376DEFN_ASN_OP_T(op, const sc_fxnum_fast &) \ 377DEFN_ASN_OP_OTHER(op) 378 379DEFN_ASN_OP(=) 380 381DEFN_ASN_OP(*=) 382DEFN_ASN_OP(/=) 383DEFN_ASN_OP(+=) 384DEFN_ASN_OP(-=) 385 386DEFN_ASN_OP_T(<<=, int) 387DEFN_ASN_OP_T(>>=, int) 388 389DEFN_ASN_OP_T(&=, const sc_fix &) 390DEFN_ASN_OP_T(&=, const sc_fix_fast &) 391DEFN_ASN_OP_T(|=, const sc_fix &) 392DEFN_ASN_OP_T(|=, const sc_fix_fast &) 393DEFN_ASN_OP_T(^=, const sc_fix &) 394DEFN_ASN_OP_T(^=, const sc_fix_fast &) 395 396#undef DEFN_ASN_OP_T 397#undef DEFN_ASN_OP_OTHER 398#undef DEFN_ASN_OP 399 400// auto-increment and auto-decrement 401template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 402inline const sc_fxval 403sc_fixed<W, I, Q, O, N>::operator ++ (int) 404{ 405 return sc_fxval(sc_fix::operator ++ (0)); 406} 407 408template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 409inline const sc_fxval 410sc_fixed<W, I, Q, O, N>::operator -- (int) 411{ 412 return sc_fxval(sc_fix::operator -- (0)); 413} 414 415template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 416inline sc_fixed<W, I, Q, O, N> & 417sc_fixed<W, I, Q, O, N>::operator ++ () 418{ 419 sc_fix::operator ++ (); 420 return *this; 421} 422 423template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 424inline sc_fixed<W, I, Q, O, N> & 425sc_fixed<W, I, Q, O, N>::operator -- () 426{ 427 sc_fix::operator -- (); 428 return *this; 429} 430 431 432// ---------------------------------------------------------------------------- 433// TEMPLATE CLASS : sc_fixed_fast 434// 435// "Constrained" signed fixed-point class; limited precision. 436// ---------------------------------------------------------------------------- 437 438template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 439inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( 440 sc_fxnum_fast_observer *observer_) : 441 sc_fix_fast(W, I, Q, O, N, observer_) 442{} 443 444template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 445inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( 446 const sc_fxcast_switch &cast_sw, sc_fxnum_fast_observer *observer_) : 447 sc_fix_fast(W, I, Q, O, N, cast_sw, observer_) 448{} 449 450#define DEFN_CTORS_T(tp) \ 451template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 452inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( \ 453 tp a, sc_fxnum_fast_observer *observer_) : \ 454 sc_fix_fast(a, W, I, Q, O, N, observer_) \ 455{} \ 456 \ 457template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 458inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( \ 459 tp a, const sc_fxcast_switch &cast_sw, \ 460 sc_fxnum_fast_observer *observer_) : \ 461 sc_fix_fast(a, W, I, Q, O, N, cast_sw, observer_) \ 462{} 463 464DEFN_CTORS_T(int) 465DEFN_CTORS_T(unsigned int) 466DEFN_CTORS_T(long) 467DEFN_CTORS_T(unsigned long) 468DEFN_CTORS_T(float) 469DEFN_CTORS_T(double) 470DEFN_CTORS_T(const char *) 471DEFN_CTORS_T(const sc_fxval &) 472DEFN_CTORS_T(const sc_fxval_fast &) 473DEFN_CTORS_T(const sc_fxnum &) 474DEFN_CTORS_T(const sc_fxnum_fast &) 475 476DEFN_CTORS_T(int64) 477DEFN_CTORS_T(uint64) 478DEFN_CTORS_T(const sc_int_base &) 479DEFN_CTORS_T(const sc_uint_base &) 480DEFN_CTORS_T(const sc_signed &) 481DEFN_CTORS_T(const sc_unsigned &) 482 483#undef DEFN_CTORS_T 484 485// copy constructor 486template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 487inline sc_fixed_fast<W, I, Q, O, N>::sc_fixed_fast( 488 const sc_fixed_fast<W, I, Q, O, N> &a) : sc_fix_fast(a, W, I, Q, O, N) 489{} 490 491// assignment operators 492template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 493inline sc_fixed_fast<W, I, Q, O, N> & 494sc_fixed_fast<W, I, Q, O, N>::operator = ( 495 const sc_fixed_fast<W, I, Q, O, N> &a) 496{ 497 sc_fix_fast::operator = (a); 498 return *this; 499} 500 501#define DEFN_ASN_OP_T(op, tp) \ 502template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> \ 503inline sc_fixed_fast<W, I, Q, O, N> & \ 504sc_fixed_fast<W, I, Q, O, N>::operator op (tp a) \ 505{ \ 506 sc_fix_fast::operator op (a); \ 507 return *this; \ 508} 509 510#define DEFN_ASN_OP_OTHER(op) \ 511DEFN_ASN_OP_T(op, int64) \ 512DEFN_ASN_OP_T(op, uint64) \ 513DEFN_ASN_OP_T(op, const sc_int_base &) \ 514DEFN_ASN_OP_T(op, const sc_uint_base &) \ 515DEFN_ASN_OP_T(op, const sc_signed &) \ 516DEFN_ASN_OP_T(op, const sc_unsigned &) 517 518#define DEFN_ASN_OP(op) \ 519DEFN_ASN_OP_T(op, int) \ 520DEFN_ASN_OP_T(op, unsigned int) \ 521DEFN_ASN_OP_T(op, long) \ 522DEFN_ASN_OP_T(op, unsigned long) \ 523DEFN_ASN_OP_T(op, float) \ 524DEFN_ASN_OP_T(op, double) \ 525DEFN_ASN_OP_T(op, const char *) \ 526DEFN_ASN_OP_T(op, const sc_fxval &) \ 527DEFN_ASN_OP_T(op, const sc_fxval_fast &) \ 528DEFN_ASN_OP_T(op, const sc_fxnum &) \ 529DEFN_ASN_OP_T(op, const sc_fxnum_fast &) \ 530DEFN_ASN_OP_OTHER(op) 531 532DEFN_ASN_OP(=) 533 534DEFN_ASN_OP(*=) 535DEFN_ASN_OP(/=) 536DEFN_ASN_OP(+=) 537DEFN_ASN_OP(-=) 538 539DEFN_ASN_OP_T(<<=, int) 540DEFN_ASN_OP_T(>>=, int) 541 542DEFN_ASN_OP_T(&=, const sc_fix &) 543DEFN_ASN_OP_T(&=, const sc_fix_fast &) 544DEFN_ASN_OP_T(|=, const sc_fix &) 545DEFN_ASN_OP_T(|=, const sc_fix_fast &) 546DEFN_ASN_OP_T(^=, const sc_fix &) 547DEFN_ASN_OP_T(^=, const sc_fix_fast &) 548 549#undef DEFN_ASN_OP_T 550#undef DEFN_ASN_OP_OTHER 551#undef DEFN_ASN_OP 552 553// auto-increment and auto-decrement 554template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 555inline const sc_fxval_fast 556sc_fixed_fast<W, I, Q, O, N>::operator ++ (int) 557{ 558 return sc_fxval_fast(sc_fix_fast::operator ++ (0)); 559} 560 561template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 562inline const sc_fxval_fast 563sc_fixed_fast<W, I, Q, O, N>::operator -- (int) 564{ 565 return sc_fxval_fast(sc_fix_fast::operator -- (0)); 566} 567 568template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 569inline sc_fixed_fast<W, I, Q, O, N> & 570sc_fixed_fast<W, I, Q, O, N>::operator ++ () 571{ 572 sc_fix_fast::operator ++ (); 573 return *this; 574} 575 576template <int W, int I, sc_q_mode Q, sc_o_mode O, int N> 577inline sc_fixed_fast<W, I, Q, O, N> & 578sc_fixed_fast<W, I, Q, O, N>::operator -- () 579{ 580 sc_fix_fast::operator -- (); 581 return *this; 582} 583 584} // namespace sc_dt 585 586#endif // __SYSTEMC_EXT_DT_FX_SC_FIXED_HH__ 587