SyoSil ApS UVM Scoreboard  1.0.3.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cl_syoscb_hash_base< HASH_DIGEST_WIDTH > Class Template Reference

Class which defines the base concept of a hash algorithm. More...

+ Inheritance diagram for cl_syoscb_hash_base< HASH_DIGEST_WIDTH >:
+ Collaboration diagram for cl_syoscb_hash_base< HASH_DIGEST_WIDTH >:

Public Types

typedef bit< HASH_DIGEST_WIDTH-1:0 > tp_hash_digest
 Typedef for a bitstream of HASH_DIGEST_WIDTH bits.
 
typedef bit< HASH_DIGEST_WIDTH-1:0 > tp_hash_digest
 Typedef for a bitstream of HASH_DIGEST_WIDTH bits.
 

Public Member Functions

virtual tp_hash_digest hash (cl_syoscb_item item)
  Hash API: Hashes a cl_syoscb_item, returning its hash value More...
 
virtual tp_hash_digest hash_str (string str)
  Hash API: Hashes a string, returning its hash value More...
 

Protected Member Functions

virtual tp_hash_digest do_hash (bit ser [])
 Hash API: Returns the hash value of the given bitstream. More...
 

Protected Attributes

cl_syoscb_cfg cfg
 Handle to the configuration object.
 
cl_syoscb_hash_packer packer
 Handle to a packer suited for this hash algorithm. More...
 

Detailed Description

template<int unsigned HASH_DIGEST_WIDTH = 1>
class cl_syoscb_hash_base< HASH_DIGEST_WIDTH >

Class which defines the base concept of a hash algorithm.

All hash functions must extend this class and implement the hash API.

Parameters
HASH_DIGEST_WIDTHThe number of bits in the hash digest for that hashing algorithm

Definition at line 4 of file cl_syoscb_hash_base.svh.

Member Function Documentation

◆ do_hash()

template<int unsigned HASH_DIGEST_WIDTH = 1>
cl_syoscb_hash_base::tp_hash_digest cl_syoscb_hash_base< HASH_DIGEST_WIDTH >::do_hash ( bit  ser[])
protectedvirtual

Hash API: Returns the hash value of the given bitstream.

The bitstream must comply with the chosen hash algorithm's requirements.

Parameters
serThe bitstream to generate the hash for
Returns
The hash of the input bitstream

Reimplemented in cl_syoscb_hash_md5, and cl_syoscb_hash_md5.

Definition at line 54 of file cl_syoscb_hash_base.svh.

Referenced by cl_syoscb_hash_base< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::hash(), and cl_syoscb_hash_base< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::hash_str().

◆ hash()

template<int unsigned HASH_DIGEST_WIDTH = 1>
cl_syoscb_hash_base::tp_hash_digest cl_syoscb_hash_base< HASH_DIGEST_WIDTH >::hash ( cl_syoscb_item  item)
virtual

Hash API: Hashes a cl_syoscb_item, returning its hash value

Parameters
itemThe item to hash
Returns
The hash value of that string

Definition at line 83 of file cl_syoscb_hash_base.svh.

◆ hash_str()

template<int unsigned HASH_DIGEST_WIDTH = 1>
cl_syoscb_hash_base::tp_hash_digest cl_syoscb_hash_base< HASH_DIGEST_WIDTH >::hash_str ( string  str)
virtual

Hash API: Hashes a string, returning its hash value

Parameters
strThe string to hash
Returns
The hash value of that string

Definition at line 62 of file cl_syoscb_hash_base.svh.

Member Data Documentation

◆ packer

template<int unsigned HASH_DIGEST_WIDTH = 1>
cl_syoscb_hash_packer cl_syoscb_hash_base< HASH_DIGEST_WIDTH >::packer
protected

Handle to a packer suited for this hash algorithm.

The packer should be set in the implementing class' constructor

Definition at line 16 of file cl_syoscb_hash_base.svh.

Referenced by cl_syoscb_hash_base< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::hash(), and cl_syoscb_hash_base< pk_syoscb::MD5_HASH_DIGEST_WIDTH >::hash_str().


The documentation for this class was generated from the following files:

Project: SyoSil ApS UVM Scoreboard, Revision: 1.0.3.0

Copyright 2014-2022 SyoSil ApS
All Rights Reserved Worldwide

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
doxygen
Doxygen Version: 1.8.14
Generated with IDV SV Filter Version: 2.6.3
Fri Sep 2 2022 14:41:05
Find a documentation bug? Report bugs to: scoreboard@syosil.com