sc_fxtype_params.cc revision 12854:c95c35407325
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_fxtype_params.cpp - 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 39// $Log: sc_fxtype_params.cpp,v $ 40// Revision 1.1.1.1 2006/12/15 20:20:04 acg 41// SystemC 2.3 42// 43// Revision 1.3 2006/01/13 18:53:58 acg 44// Andy Goodrich: added $Log command so that CVS comments are reproduced in 45// the source. 46// 47 48#include <sstream> 49 50#include "systemc/ext/dt/fx/sc_fxtype_params.hh" 51 52namespace sc_dt 53{ 54 55template class sc_global<sc_fxtype_params>; 56template class sc_context<sc_fxtype_params>; 57 58// ---------------------------------------------------------------------------- 59// CLASS : sc_fxtype_params 60// 61// Fixed-point type parameters class. 62// ---------------------------------------------------------------------------- 63 64const std::string 65sc_fxtype_params::to_string() const 66{ 67 std::stringstream ss; 68 print(ss); 69 return ss.str(); 70} 71 72void 73sc_fxtype_params::print(::std::ostream &os) const 74{ 75 os << "(" 76 << m_wl << "," 77 << m_iwl << "," 78 << m_q_mode << "," 79 << m_o_mode << "," 80 << m_n_bits 81 << ")"; 82} 83 84void 85sc_fxtype_params::dump(::std::ostream &os) const 86{ 87 os << "sc_fxtype_params" << ::std::endl; 88 os << "(" << ::std::endl; 89 os << "wl = " << m_wl << ::std::endl; 90 os << "iwl = " << m_iwl << ::std::endl; 91 os << "q_mode = " << m_q_mode << ::std::endl; 92 os << "o_mode = " << m_o_mode << ::std::endl; 93 os << "n_bits = " << m_n_bits << ::std::endl; 94 os << ")" << ::std::endl; 95} 96 97} // namespace sc_dt 98