1- /* ******************************************************************************
2- * Copyright 2017 eyck@minres.com
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5- * use this file except in compliance with the License. You may obtain a copy
6- * 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, WITHOUT
12- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13- * License for the specific language governing permissions and limitations under
14- * the License.
15- ******************************************************************************/
1+ // //////////////////////////////////////////////////////////////////////////////
2+ // Copyright (C) 2017, MINRES Technologies GmbH
3+ // All rights reserved.
4+ //
5+ // Redistribution and use in source and binary forms, with or without
6+ // modification, are permitted provided that the following conditions are met:
7+ //
8+ // 1. Redistributions of source code must retain the above copyright notice,
9+ // this list of conditions and the following disclaimer.
10+ //
11+ // 2. Redistributions in binary form must reproduce the above copyright notice,
12+ // this list of conditions and the following disclaimer in the documentation
13+ // and/or other materials provided with the distribution.
14+ //
15+ // 3. Neither the name of the copyright holder nor the names of its contributors
16+ // may be used to endorse or promote products derived from this software
17+ // without specific prior written permission.
18+ //
19+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+ // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+ // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22+ // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23+ // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24+ // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25+ // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26+ // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27+ // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28+ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29+ // POSSIBILITY OF SUCH DAMAGE.
30+ //
31+ // Contributors:
32+ // eyck@minres.com - initial implementation
33+ //
34+ //
35+ // //////////////////////////////////////////////////////////////////////////////
1636
1737#ifndef _GPIO_H_
1838#define _GPIO_H_
1939
2040#include " scc/tlm_target.h"
41+ #include " scc/ext_attribute.h"
2142#include < sysc/communication/sc_signal_rv_ports.h>
2243
2344namespace sysc {
@@ -35,11 +56,13 @@ class gpio : public sc_core::sc_module, public scc::tlm_target<> {
3556 gpio (sc_core::sc_module_name nm);
3657 virtual ~gpio () override ; // need to keep it in source file because of fwd declaration of gpio_regs
3758
59+ scc::ext_attribute<bool > write_to_ws;
3860protected:
3961 void clock_cb ();
4062 void reset_cb ();
4163 void update_pins ();
4264 void pins_cb ();
65+ void before_end_of_elaboration ();
4366 sc_core::sc_time clk;
4467 std::unique_ptr<gpio_regs> regs;
4568 std::shared_ptr<sysc::WsHandler> handler;
0 commit comments