7 RAMPortComponent::RAMPortComponent(std::unique_ptr<GateTypeComponent> component,
8 const std::string& data_group,
9 const std::string& addr_group,
10 const BooleanFunction& clock_bf,
11 const BooleanFunction& enable_bf,
13 : m_component(
std::move(component)), m_data_group(data_group), m_addr_group(addr_group), m_clock_bf(clock_bf.clone()), m_enable_bf(enable_bf.clone()), m_is_write(is_write)
17 std::unique_ptr<RAMPortComponent> RAMPortComponent::create(std::unique_ptr<GateTypeComponent> component,
18 const std::string& data_group,
19 const std::string& addr_group,
24 return std::unique_ptr<RAMPortComponent>(
new RAMPortComponent(std::move(component), data_group, addr_group, clock_bf.
clone(), enable_bf.
clone(), is_write));
34 return component->
get_type() == m_type;
37 std::vector<GateTypeComponent*> RAMPortComponent::get_components(
const std::function<
bool(
const GateTypeComponent*)>& filter)
const
39 if (m_component !=
nullptr)
41 std::vector<GateTypeComponent*> res = m_component->get_components(filter);
44 if (filter(m_component.get()))
46 res.push_back(m_component.get());
51 res.push_back(m_component.get());
60 const std::string& RAMPortComponent::get_data_group()
const
65 void RAMPortComponent::set_data_group(
const std::string& data_group)
67 m_data_group = data_group;
70 const std::string& RAMPortComponent::get_address_group()
const
75 void RAMPortComponent::set_address_group(
const std::string& addr_group)
77 m_addr_group = addr_group;
87 m_clock_bf = clock_bf.
clone();
97 m_enable_bf = enable_bf.
clone();
100 bool RAMPortComponent::is_write_port()
const
105 void RAMPortComponent::set_write_port(
bool is_write)
107 m_is_write = is_write;
BooleanFunction clone() const
virtual ComponentType get_type() const =0