sc_lv_base.cc (13322:7391057615bd) sc_lv_base.cc (13325:86323e6cc8ec)
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

--- 36 unchanged lines hidden (view full) ---

45//
46// Revision 1.3 2006/01/13 18:53:53 acg
47// Andy Goodrich: added $Log command so that CVS comments are reproduced in
48// the source.
49//
50
51#include <sstream>
52
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

--- 36 unchanged lines hidden (view full) ---

45//
46// Revision 1.3 2006/01/13 18:53:53 acg
47// Andy Goodrich: added $Log command so that CVS comments are reproduced in
48// the source.
49//
50
51#include <sstream>
52
53#include "systemc/ext/dt/bit/messages.hh"
53#include "systemc/ext/dt/bit/sc_lv_base.hh"
54#include "systemc/ext/utils/messages.hh"
55
56namespace sc_dt
57{
58
59// explicit template instantiations
60template class sc_proxy<sc_lv_base>;

--- 24 unchanged lines hidden (view full) ---

85 SC_DIGIT_ZERO, SC_DIGIT_ZERO, ~SC_DIGIT_ZERO, ~SC_DIGIT_ZERO
86};
87
88void
89sc_lv_base::init(int length_, const sc_logic& init_value)
90{
91 // check the length
92 if (length_ <= 0) {
54#include "systemc/ext/dt/bit/sc_lv_base.hh"
55#include "systemc/ext/utils/messages.hh"
56
57namespace sc_dt
58{
59
60// explicit template instantiations
61template class sc_proxy<sc_lv_base>;

--- 24 unchanged lines hidden (view full) ---

86 SC_DIGIT_ZERO, SC_DIGIT_ZERO, ~SC_DIGIT_ZERO, ~SC_DIGIT_ZERO
87};
88
89void
90sc_lv_base::init(int length_, const sc_logic& init_value)
91{
92 // check the length
93 if (length_ <= 0) {
93 SC_REPORT_ERROR("zero length", 0);
94 SC_REPORT_ERROR(sc_core::SC_ID_ZERO_LENGTH_, 0);
94 sc_core::sc_abort(); // can't recover from here
95 }
96 // allocate memory for the data and control words
97 m_len = length_;
98 m_size = (m_len - 1) / SC_DIGIT_SIZE + 1;
99 m_data = new sc_digit[m_size * 2];
100 m_ctrl = m_data + m_size;
101 // initialize the bits to 'init_value'

--- 80 unchanged lines hidden ---
95 sc_core::sc_abort(); // can't recover from here
96 }
97 // allocate memory for the data and control words
98 m_len = length_;
99 m_size = (m_len - 1) / SC_DIGIT_SIZE + 1;
100 m_data = new sc_digit[m_size * 2];
101 m_ctrl = m_data + m_size;
102 // initialize the bits to 'init_value'

--- 80 unchanged lines hidden ---