void uvm_packer_rep::unpack_sc_signed(sc_signed& a) {
  int n = a.length();
  for (int i = 0; i < n; i++) {
    sc_dt::sc_logic_value_t val = (*m_bits).get_bit(unpack_index);
    if (int(val) == int(sc_dt::Log_1)) {
      a.set(i, true);
    } else {
      a.set(i, false);
    }
    unpack_index++;
  }
}
void uvm_packer_rep::pack_sc_signed(const sc_signed& a) {
  int n = a.length();
  check_size(n);
  for (int i = 0; i < n; i++) {
    bool val = a.test(i);
    if (val) {
      (*m_bits).set_bit(pack_index, sc_dt::Log_1);
    } else {
      (*m_bits).set_bit(pack_index, sc_dt::Log_0);
    }
    pack_index++;
  }
}
Exemple #3
0
void
check_string( const sc_signed& z, int v )
{
    std::string buf( z.to_string( SC_BIN ) );
    if (z < 0) {
        assert(buf[2] == '1');
    } else {
        assert(buf[2] == '0');
    }
}
void sc_uint_bitref::concat_set(const sc_signed& src, int low_i)
{
    sc_uint_base aa( 1 );     
    if ( low_i < src.length() )
        *this = aa = 1 & (src >> low_i);      
    else