diff --git a/comdel/display/component_display.cpp b/comdel/display/component_display.cpp index 086578d..ba55739 100644 --- a/comdel/display/component_display.cpp +++ b/comdel/display/component_display.cpp @@ -4,9 +4,9 @@ #include "mainwindow.h" #include +#include #include #include -#include namespace display { @@ -47,14 +47,20 @@ void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { auto view = dynamic_cast(this->scene()->views()[0]); view->state = Schema::CREATING_CONNECTION; view->context.pin = this; - view->context.startingPoint = view->mapToScene(event->pos().toPoint()); + view->context.startingPoint = dynamic_cast(this->parentItem())->pos() + QPointF(pin.getDisplayPin().getConnectionX(), pin.getDisplayPin().getConnectionY()); + view->context.line = new QGraphicsLineItem(QLineF(view->context.startingPoint, event->scenePos())); + this->scene()->addItem(view->context.line); + + view->showConnectable(this); } } void Pin::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { auto view = dynamic_cast(this->scene()->views()[0]); if(view->state == Schema::CREATING_CONNECTION) { - + auto line = view->context.line->line(); + line.setP2(event->scenePos()); + view->context.line->setLine(line); } } @@ -62,6 +68,9 @@ void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { if(event->button() == Qt::MouseButton::LeftButton) { auto view = dynamic_cast(this->scene()->views()[0]); view->state = Schema::DEFAULT; + this->scene()->removeItem(view->context.line); + delete view->context.line; + view->removeConnectable(event->scenePos()); } } diff --git a/comdel/display/component_display.h b/comdel/display/component_display.h index 792bd23..f82d7c8 100644 --- a/comdel/display/component_display.h +++ b/comdel/display/component_display.h @@ -15,8 +15,10 @@ class Pin: public QGraphicsItemGroup { private: domain::Pin pin; + std::shared_ptr componentInstance; + public: - Pin(domain::Pin pin): pin(pin) { + Pin(domain::Pin pin, std::shared_ptr componentInstance): pin(pin), componentInstance(componentInstance) { pin.getDisplayPin().render(this); } @@ -25,6 +27,13 @@ public: void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; + domain::Pin& getPin() { + return pin; + } + + domain::ComponentInstance* getComponentInstance() { + return componentInstance.get(); + } }; class Component: public QGraphicsItemGroup @@ -56,8 +65,13 @@ class ComponentGroup: public QGraphicsItemGroup { private: std::shared_ptr componentInstance; + std::vector pins; public: + + std::shared_ptr getComponentInstance() { return componentInstance; } + std::vector& getPins() { return pins; } + explicit ComponentGroup(const std::shared_ptr& instance): componentInstance(instance) { setFlag(ItemIsMovable, true); setFlag(ItemSendsGeometryChanges, true); @@ -67,7 +81,8 @@ public: addToGroup(new display::Component(instance)); for(auto &pin: instance->component.getPins()) { - addToGroup(new display::Pin(pin)); + pins.push_back(new display::Pin(pin, componentInstance)); + addToGroup(pins.back()); } setPos(instance->position.first, instance->position.second); @@ -118,6 +133,12 @@ public: auto pin = connection->instance->component.getPin(connection->connection.getComponent().pin).getDisplayPin(); setLine(connection->instance->position.first + pin.getConnectionX(), connection->instance->position.second + pin.getConnectionY(), connection->bus->position.first + busPosition.width()/2, connection->bus->position.second + busPosition.height()/2); + + connection->start.first = connection->instance->position.first + pin.getConnectionX(); + connection->start.second = connection->instance->position.second + pin.getConnectionY(); + connection->end.first = connection->bus->position.first + busPosition.width()/2; + connection->end.second = connection->bus->position.second + busPosition.height()/2; + } void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override; @@ -130,10 +151,9 @@ public: domain::DirectConnectionInstance* connection; ComponentGroup* first; ComponentGroup* second; - BusGroup* bus; public: - DirectConnection(domain::DirectConnectionInstance* connection, ComponentGroup *first, ComponentGroup *second, BusGroup *bus): connection(connection), first(first), second(second), bus(bus) { + DirectConnection(domain::DirectConnectionInstance* connection, ComponentGroup *first, ComponentGroup *second): connection(connection), first(first), second(second) { updateConnection(); setHandlesChildEvents(false); } @@ -144,6 +164,12 @@ public: setLine(connection->instance->position.first + pin1.getConnectionX(), connection->instance->position.second + pin1.getConnectionY(), connection->secondInstance->position.first + pin2.getConnectionX(), connection->secondInstance->position.second + pin2.getConnectionY()); + + connection->start.first = connection->instance->position.first + pin1.getConnectionX(); + connection->start.second = connection->instance->position.second + pin1.getConnectionY(); + connection->end.first = connection->secondInstance->position.first + pin2.getConnectionX(); + connection->end.second = connection->secondInstance->position.second + pin2.getConnectionY(); + } void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override; diff --git a/comdel/display/schema_display.cpp b/comdel/display/schema_display.cpp index 7dae0e8..01f0b88 100644 --- a/comdel/display/schema_display.cpp +++ b/comdel/display/schema_display.cpp @@ -3,14 +3,15 @@ #include #include -#include #include -#include namespace display { Schema::Schema() { + this->selectedBrush.setColor(QColor::fromRgb(20,20,125)); + this->selectedPen.setColor(QColor::fromRgb(20, 20, 125)); + this->setScene(&scene); this->setAcceptDrops(true); } @@ -18,16 +19,21 @@ Schema::Schema() void Schema::setSchema(domain::Schema* _schema, domain::Library* _library) { - std::map components; - std::map buses; + components.clear(); + buses.clear(); scene.clear(); - connections.clear(); + busConnections.clear(); this->schema = _schema; this->library = _library; if(schema != nullptr) { for(auto &instance: schema->componentInstances) { auto group = new display::ComponentGroup(instance); + for(auto pin: group->getPins()) { + display::Pin* p = pin; + domain::ConnectionComponent connection{instance->name, p->getPin().getName()}; + pins.insert(std::make_pair(connection, p)); + } components.insert(std::make_pair(instance->name, group)); scene.addItem(group); } @@ -42,7 +48,13 @@ void Schema::setSchema(domain::Schema* _schema, domain::Library* _library) auto busInstance = dynamic_cast(connection.get()); if(busInstance != nullptr) { auto con = new display::BusConnection(busInstance, components[busInstance->instance->name], buses[busInstance->bus->name]); - connections.push_back(con); + busConnections.push_back(con); + scene.addItem(con); + } + auto directInstance = dynamic_cast(connection.get()); + if(directInstance != nullptr) { + auto con = new display::DirectConnection(directInstance, components[directInstance->instance->name], components[directInstance->secondInstance->name]); + directConnections.push_back(con); scene.addItem(con); } } @@ -51,7 +63,10 @@ void Schema::setSchema(domain::Schema* _schema, domain::Library* _library) void Schema::updateConnections() { if(schema != nullptr) { - for(auto conn: connections) { + for(auto conn: busConnections) { + conn->updateConnection(); + } + for(auto conn: directConnections) { conn->updateConnection(); } } @@ -61,8 +76,6 @@ void Schema::updateConnections() { if(event->mimeData()->hasFormat("comdel/component") || event->mimeData()->hasFormat("comdel/bus")) { event->acceptProposedAction(); - } else { - std::cout<<"false"<< std::endl; } } @@ -82,6 +95,13 @@ void Schema::updateConnections() { auto group = new display::ComponentGroup(instance); scene.addItem(group); + for(auto pin: group->getPins()) { + display::Pin* p = pin; + domain::ConnectionComponent connection{instance->name, p->getPin().getName()}; + pins.insert(std::make_pair(connection, p)); + } + + components[instance->name] = group; event->acceptProposedAction(); } @@ -95,6 +115,7 @@ void Schema::updateConnections() { auto group = new display::BusGroup(instance); scene.addItem(group); + buses[instance->name] = group; event->acceptProposedAction(); } @@ -104,4 +125,140 @@ void Schema::updateConnections() { event->acceptProposedAction(); } + void Schema::removeConnectable(QPointF endPoint) { + auto instance = context.pin->getComponentInstance(); + auto& pin = context.pin->getPin(); + + auto busInstances = getAvailableConnectionBusses(instance, pin); + + for(auto &bus: busInstances) { + auto rect = buses[bus->name]->boundingRect(); + rect = QRectF(buses[bus->name]->x(), buses[bus->name]->y(), rect.width(), rect.height()); + + if(rect.contains(endPoint)) { + auto con = library->getConnection({instance->component.getName(), pin.getName()}, bus->bus.getName()); + if(con.has_value()) { + std::vector attributes; + for(auto attr: con->getAttributes()) { + attributes.emplace_back(attr.getName(), attr.getDefault(), attr); + } + + auto conInstance = std::make_shared(instance, attributes, bus, *con); + schema->connections.push_back(conInstance); + + if (conInstance != nullptr) { + auto c = new display::BusConnection(conInstance.get(), components[conInstance->instance->name], + buses[conInstance->bus->name]); + busConnections.push_back(c); + scene.addItem(c); + } + break; + } + } + } + + auto pinInstances = getAvailableConnectionPins(instance, pin); + + for(auto &pinInstance: pinInstances) { + auto rect = pins[pinInstance]->boundingRect(); + rect.setX(pins[pinInstance]->scenePos().x()); + rect.setY(pins[pinInstance]->scenePos().y()); + + if(rect.contains(endPoint)) { + auto name = components[pinInstance.component]->getComponentInstance()->component.getName(); + auto con = library->getConnection({instance->component.getName(), pin.getName()}, {name, pinInstance.pin}); + if(con.has_value()) { + auto bus = library->getBus(con->getBus()); + auto busInstance = std::make_shared(bus.getName(), bus); + schema->busInstances.push_back(busInstance); + + std::vector attributes; + for(auto attr: con->getAttributes()) { + attributes.emplace_back(attr.getName(), attr.getDefault(), attr); + } + + auto conInstance = std::make_shared(instance, components[pinInstance.component]->getComponentInstance().get(), attributes, busInstance.get(), *con); + schema->connections.push_back(conInstance); + + if (conInstance != nullptr) { + auto c = new display::DirectConnection(conInstance.get(), components[conInstance->instance->name], components[conInstance->secondInstance->name]); + directConnections.push_back(c); + scene.addItem(c); + } + break; + } + } + } + + updateConnections(); + + + for(auto& item: this->context.selectable) { + this->scene.removeItem(item); + delete item; + } + this->context.selectable.clear(); + } + + void Schema::showConnectable(Pin *domainPin) { + auto& pin = domainPin->getPin(); + + auto busInstances = getAvailableConnectionBusses(domainPin->getComponentInstance(), domainPin->getPin()); + + for(auto bus: busInstances) { + auto& group = buses[bus->name]; + auto rect = new QGraphicsRectItem(group->boundingRect()); + rect->setPen(selectedPen); + rect->setPos(group->scenePos()); + + auto _rect = rect->rect(); + _rect.setWidth(_rect.width() + 1); + _rect.setHeight(_rect.height() + 1); + rect->setRect(_rect); + + context.selectable.push_back(rect); + scene.addItem(rect); + } + + std::vector pinInstances = getAvailableConnectionPins(domainPin->getComponentInstance(), domainPin->getPin()); + + for(auto& pinInstance: pinInstances) { + auto& instance = pins[pinInstance]; + auto rect = new QGraphicsRectItem(instance->boundingRect()); + rect->setPen(selectedPen); + rect->setPos(instance->scenePos()); + + auto _rect = rect->rect(); + _rect.setWidth(_rect.width() + 1); + _rect.setHeight(_rect.height() + 1); + rect->setRect(_rect); + + context.selectable.push_back(rect); + scene.addItem(rect); + } + + } + + std::vector Schema::getAvailableConnectionBusses(domain::ComponentInstance *instance, domain::Pin &pin) { + std::vector instances; + for(const auto& bus: schema->busInstances) { + if(library->hasConnection(domain::ConnectionComponent{instance->component.getName(), pin.getName()}, bus->bus.getName())) { + instances.push_back(bus.get()); + } + } + return instances; + } + + std::vector Schema::getAvailableConnectionPins(domain::ComponentInstance *instance, domain::Pin &pin) { + std::vector instances; + domain::ConnectionComponent source{instance->component.getName(), pin.getName()}; + for(const auto& entry: pins) { + std::string name = components[entry.first.component]->getComponentInstance()->component.getName(); + if(library->hasConnection(source, domain::ConnectionComponent{name, entry.first.pin})) { + instances.push_back(entry.first); + } + } + return instances; + } + } // namespace display diff --git a/comdel/display/schema_display.h b/comdel/display/schema_display.h index 131f0bd..0d0173e 100644 --- a/comdel/display/schema_display.h +++ b/comdel/display/schema_display.h @@ -4,9 +4,11 @@ #include #include +#include #include #include +#include "component_display.h" namespace display { @@ -18,27 +20,41 @@ class Schema: public QGraphicsView public: + QBrush selectedBrush; + QPen selectedPen; + enum State { DEFAULT, CREATING_CONNECTION }; struct Context { - display::Pin *pin; + display::Pin *pin = nullptr; QPointF startingPoint; + QGraphicsLineItem *line = nullptr; + std::vector selectable; }; + std::map components; + std::map buses; + std::map pins; + State state = DEFAULT; Context context; Schema(); - std::vector connections; + std::vector busConnections; + std::vector directConnections; void setSchema(domain::Schema* schema, domain::Library* library); void updateConnections(); + void removeConnectable(QPointF f); + + void showConnectable(Pin *pin); + protected: void dragEnterEvent(QDragEnterEvent *event) override; @@ -50,6 +66,10 @@ private: domain::Schema* schema; domain::Library* library; + + std::vector getAvailableConnectionBusses(domain::ComponentInstance *instance, domain::Pin &pin); + + std::vector getAvailableConnectionPins(domain::ComponentInstance *instance, domain::Pin &pin); }; } // namespace display diff --git a/comdel/domain/comdel_generator.cpp b/comdel/domain/comdel_generator.cpp index fabf606..03836dc 100644 --- a/comdel/domain/comdel_generator.cpp +++ b/comdel/domain/comdel_generator.cpp @@ -94,6 +94,7 @@ void generateComdelFile(Schema *schema, Library &library, std::ostream &buffer) } void generateBus(BusInstance *bus, ostream &buffer); +void generateConnection(ConnectionInstance *connection, ostream &buffer); void generateDisplay(Schema *schema, ostream &buffer) { buffer << "\n\tdisplay {\n"; @@ -106,9 +107,20 @@ void generateDisplay(Schema *schema, ostream &buffer) { generateBus(bus.get(), buffer); } + buffer << "\n"; + + for(auto &connection: schema->connections) { + generateConnection(connection.get(), buffer); + } + buffer << "\t}\n"; } +void generateConnection(ConnectionInstance *connection, ostream &buffer) { + buffer << "\t\tline {x1:" << connection->start.first << "; y1:" << connection->start.second << "; " << + "x2:" << connection->end.first << "; y2:" << connection->end.second << ";}" << "\n"; +} + void generateBus(BusInstance *bus, ostream &buffer) { buffer << "\n"; buffer << "\t\t// " << bus->name << " bus\n\n"; diff --git a/comdel/domain/connection.cpp b/comdel/domain/connection.cpp index 7f611b7..601f5ec 100644 --- a/comdel/domain/connection.cpp +++ b/comdel/domain/connection.cpp @@ -63,4 +63,14 @@ bool Connection::isConnecting(ConnectionComponent component, std::string bus, Co (this->first == secondComponent && this->bus == bus && this->second == component); } + + bool Connection::isConnecting(ConnectionComponent component, ConnectionComponent secondComponent) { + if(!second.has_value()) { + return false; + } + return (this->first == component && this->second == secondComponent) || + (this->first == secondComponent && this->second == component); + } + + } // namespace domain diff --git a/comdel/domain/connection.h b/comdel/domain/connection.h index 362cd5c..8319ee7 100644 --- a/comdel/domain/connection.h +++ b/comdel/domain/connection.h @@ -21,6 +21,17 @@ struct ConnectionComponent { return !operator==(rhs); } + bool operator<(const ConnectionComponent& rhs) const + { + if(component < rhs.component) { + return true; + } else if(component == rhs.component) { + if(pin < rhs.pin) { + return true; + } + } + return false; + } }; class Connection @@ -40,6 +51,7 @@ public: bool isConnecting(ConnectionComponent first); bool isConnecting(ConnectionComponent first, std::string bus); bool isConnecting(ConnectionComponent first, std::string bus, ConnectionComponent second); + bool isConnecting(ConnectionComponent first, ConnectionComponent second); ConnectionComponent getComponent(); diff --git a/comdel/domain/connectioninstance.h b/comdel/domain/connectioninstance.h index 6e3d7e0..e84b171 100644 --- a/comdel/domain/connectioninstance.h +++ b/comdel/domain/connectioninstance.h @@ -5,8 +5,6 @@ #include "instance.h" #include "wireinstance.h" - - namespace domain { class ConnectionInstance @@ -19,6 +17,9 @@ public: std::vector attributes; + std::pair start; + std::pair end; + ConnectionInstance(ComponentInstance *instance, std::vector attributes, Connection connection); InstanceAttribute getAttribute(string attribute); diff --git a/comdel/domain/instance.cpp b/comdel/domain/instance.cpp index fde02d5..7deb689 100644 --- a/comdel/domain/instance.cpp +++ b/comdel/domain/instance.cpp @@ -5,7 +5,10 @@ namespace domain { BusInstance::BusInstance(std::string name, std::pair position, Bus bus, int size) : name(name), position(position), bus(bus), size(size) {} -ComponentInstance::ComponentInstance(std::string name, std::vector attributes, std::pair position, Component component) + + BusInstance::BusInstance(std::string name, Bus bus): name(name), bus(bus), position(0,0), size(0) {} + + ComponentInstance::ComponentInstance(std::string name, std::vector attributes, std::pair position, Component component) : name(name), attributes(std::move(attributes)), position(position), component(component) {} diff --git a/comdel/domain/instance.h b/comdel/domain/instance.h index 1e8412a..38c158d 100644 --- a/comdel/domain/instance.h +++ b/comdel/domain/instance.h @@ -21,6 +21,8 @@ public: Bus bus; int size; + BusInstance(std::string name, Bus bus); + BusInstance(std::string name, std::pair position, Bus bus, int size); virtual ~BusInstance() = default; diff --git a/comdel/domain/library.cpp b/comdel/domain/library.cpp index 295070e..e36d33e 100644 --- a/comdel/domain/library.cpp +++ b/comdel/domain/library.cpp @@ -113,4 +113,18 @@ std::string Library::getMessage(std::string key) { return messages[key]; } + bool Library::hasConnection(ConnectionComponent component, ConnectionComponent secondComponent) { + return getConnection(component, secondComponent).has_value(); + } + + std::optional + Library::getConnection(ConnectionComponent component, ConnectionComponent secondComponent) { + for(auto & connection : connections) { + if(connection.isConnecting(component, secondComponent)) { + return connection; + } + } + return nullopt; + } + } // namespace domain diff --git a/comdel/domain/library.h b/comdel/domain/library.h index 984cc63..921d278 100644 --- a/comdel/domain/library.h +++ b/comdel/domain/library.h @@ -60,6 +60,10 @@ public: bool hasConnection(ConnectionComponent component, std::string bus, ConnectionComponent secondComponent); std::optional getConnection(ConnectionComponent component, std::string bus, ConnectionComponent secondComponent); + + bool hasConnection(ConnectionComponent component, ConnectionComponent secondComponent); + std::optional getConnection(ConnectionComponent component, ConnectionComponent secondComponent); + }; } // namespace domain diff --git a/comdel/domain/schema.h b/comdel/domain/schema.h index bcdadba..7d9ba0b 100644 --- a/comdel/domain/schema.h +++ b/comdel/domain/schema.h @@ -9,8 +9,7 @@ namespace domain { -class Schema -{ +class Schema { public: Schema(); @@ -19,16 +18,8 @@ public: std::vector> connections; - BusInstance *getBusInstance(std::string& name) { - for(auto& instance: busInstances) { - if (instance->name == name) { - return instance.get(); - } - } - return nullptr; - } - ComponentInstance *getComponentInstance(std::string& name) { - for(auto& instance: componentInstances) { + BusInstance *getBusInstance(std::string &name) { + for (auto &instance: busInstances) { if (instance->name == name) { return instance.get(); } @@ -36,8 +27,18 @@ public: return nullptr; } - bool hasConnection(string& component, string& pin); - ConnectionInstance* getConnection(string& component, string& pin); + ComponentInstance *getComponentInstance(std::string &name) { + for (auto &instance: componentInstances) { + if (instance->name == name) { + return instance.get(); + } + } + return nullptr; + } + + bool hasConnection(string &component, string &pin); + + ConnectionInstance *getConnection(string &component, string &pin); }; } // namespace domain diff --git a/examples/simplified FRISC model/comdel.system b/examples/simplified FRISC model/comdel.system new file mode 100644 index 0000000..2d81486 --- /dev/null +++ b/examples/simplified FRISC model/comdel.system @@ -0,0 +1,53 @@ +// Version 0.0.1 +#include "libraries\frisc\vjezba1\FRISC.cdl" +#include "libraries\frisc\vjezba1\memory.cdl" + + + +component System +{ + clock 100MHz; + //directRam + wire INT; + + + //glavnaSabirnica + wire<32> ADR; + wire<32> DATA; + wire READ; + wire WRITE; + wired_and WAIT; + wired_and INT0; + wired_and INT1; + wired_and INT2; + wired_and INT3; + wire<3> SIZE; + wire --IACK; + wire --BREQ; + wire --BACK; + + + // components -------------------------------------------- + subcomponent Memorija memorija(ADR, DATA, READ, WRITE, SIZE, WAIT, INT); + subcomponent FRISC procesor(ADR, DATA, READ, WRITE, SIZE, WAIT, INT0, INT1, INT2, INT3, --IACK, 1, *, INT) uses memorija; + + display { + component { x: -12; y: 68; ref: "memorija"; } + component { x: -206; y: -76; ref: "procesor"; } + + // directRam bus + + + // glavnaSabirnica bus + + rectangle { + x: -222; y: 130; + w: 100; h: 20; + } + + + line {x1:-28; y1:96; x2:-90; y2:-26;} + line {x1:38; y1:52; x2:-171; y2:140;} + line {x1:-156; y1:40; x2:-171; y2:140;} + } +} \ No newline at end of file diff --git a/examples/simplified FRISC model/frisc_library.csl b/examples/simplified FRISC model/frisc_library.csl index a4d7075..1c4560b 100644 --- a/examples/simplified FRISC model/frisc_library.csl +++ b/examples/simplified FRISC model/frisc_library.csl @@ -62,6 +62,18 @@ } } } + + @pin memDirect inOut { + @tooltip "pin za izravno spajanje na RAM" + @connection optional("COMDEL se ne može stvoriti. FRISC nije spojen na sabirnicu") + @display { + pin { + x: 100; y: 42; w: 16; h:16; + type: "in"; + orientation: "right"; + } + } + } } @component Memorija memory { @@ -181,6 +193,29 @@ } } } + + @pin memDirect inOut { + @tooltip "pin za spajanje na procesor" + @connection optional("COMDEL se ne može stvoriti. Memorija nije spojena na sabirnicu") + @display { + /* + pin { + x: 100; y: 25; + fillColor: blue; + lineColor: red; + fillColorConnected: white; + lineColorConnected: black; + side: right; + size: 20; + } + */ + pin { + x: -16; y: 20; w: 16; h:16; + type: "out"; + orientation: "left"; + } + } + } } @component DMA { @@ -305,6 +340,13 @@ } } +@bus directRam automatic { + @wires { + INT + } +} + + @connection (FRISC.glavniPin, glavnaSabirnica) { @wires{ADR, DATA, READ, WRITE, SIZE, WAIT, INT0, INT1, INT2, INT3, IACK, 1, null} } @@ -331,4 +373,9 @@ @connection (DMA.glavniPin, PIOSabirnica, FRISC.glavniPin) { @wires{PIO_DATA, READY, STROBE} @wires{PIO_DATA, READY, STROBE} +} + +@connection (FRISC.memDirect, directRam, Memorija.memDirect) { + @wires{INT} + @wires{INT} } \ No newline at end of file diff --git a/examples/simplified FRISC model/schema3.csl b/examples/simplified FRISC model/schema3.csl new file mode 100644 index 0000000..9ce8028 --- /dev/null +++ b/examples/simplified FRISC model/schema3.csl @@ -0,0 +1,34 @@ +@source "/home/bbr/Documents/Personal/FER/schema_editor/examples/simplified FRISC model/frisc_library.csl" + +@schema { + @instance memorija Memorija { + @position (-12, 68) + @attribute sinkroniziran false + @attribute brzina 1 + @attribute kapacitet 65536 + @attribute size 8 + @attribute pocetnaAdresa 0 + } + + @instance procesor FRISC { + @position (-206, -76) + @attribute _memory memorija + } + + @instance directRam directRam { + @position (0, 0) + @size 0 + } + + @instance glavnaSabirnica glavnaSabirnica { + @position (-222, 130) + @size 50 + } + + @connection (memorija.memDirect, directRam, procesor.memDirect) { + } + @connection (memorija.glavniPin, glavnaSabirnica) { + } + @connection (procesor.glavniPin, glavnaSabirnica) { + } +}