Deleted Added
sdiff udiff text old ( 13303:045f002c325c ) new ( 13324:c8b709468e61 )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

31#define __SYSTEMC_EXT_CHANNEL_SC_FIFO_HH__
32
33#include <list>
34#include <string>
35
36#include "../core/sc_module.hh" // for sc_gen_unique_name
37#include "../core/sc_prim.hh"
38#include "../utils/sc_report_handler.hh"
39#include "sc_fifo_in_if.hh"
40#include "sc_fifo_out_if.hh"
41
42namespace sc_core
43{
44
45class sc_port_base;
46class sc_event;

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

64 virtual ~sc_fifo() {}
65
66 virtual void
67 register_port(sc_port_base &port, const char *iface_type_name)
68 {
69 std::string tn(iface_type_name);
70 if (tn == typeid(sc_fifo_in_if<T>).name() ||
71 tn == typeid(sc_fifo_blocking_in_if<T>).name()) {
72 if (_reader) {
73 SC_REPORT_ERROR(
74 "(E104) sc_fifo<T> cannot have more than one reader",
75 "");
76 }
77 _reader = &port;
78 } else if (tn == typeid(sc_fifo_out_if<T>).name() ||
79 tn == typeid(sc_fifo_blocking_out_if<T>).name()) {
80 if (_writer) {
81 SC_REPORT_ERROR(
82 "(E105) sc_fifo<T> cannot have more than one writer",
83 "");
84 }
85 _writer = &port;
86 } else {
87 SC_REPORT_ERROR("(E107) bind interface to port failed",
88 "sc_fifo<T> port not recognized");
89 }
90 }
91
92 virtual void
93 read(T &t)
94 {
95 while (num_available() == 0)

--- 141 unchanged lines hidden ---