scc  2022.4.0
SystemC components library
time2tick.h
1 /*******************************************************************************
2  * Copyright 2018-2021 MINRES Technologies GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *******************************************************************************/
16 
17 #ifndef _SCC_TIME2TICK_H_
18 #define _SCC_TIME2TICK_H_
19 
20 #include "utilities.h"
21 
27 namespace scc {
33 struct time2tick : public sc_core::sc_module {
37  sc_core::sc_in<sc_core::sc_time> clk_i{"clk_i"};
39  sc_core::sc_out<bool> clk_o{"clk_o"};
45  explicit time2tick(sc_core::sc_module_name nm)
46  : sc_core::sc_module(nm) {
47  SC_THREAD(clocker);
48  }
49 
50 private:
51  sc_core::sc_time clk_period;
52  void clocker();
53 };
54 } // namespace scc // end of scc-sysc
56 #endif /* _SCC_TIME2TICK_H_ */
SCC SystemC utilities.
translate a tick-less clock (sc_time based) to boolean clock
Definition: time2tick.h:33
time2tick(sc_core::sc_module_name nm)
Definition: time2tick.h:45
sc_core::sc_out< bool > clk_o
the clock output
Definition: time2tick.h:39
SC_HAS_PROCESS(time2tick)
yes, we have processes
sc_core::sc_in< sc_core::sc_time > clk_i
the clock input
Definition: time2tick.h:37