@@ -867,4 +867,88 @@ class verilog_sva_sequence_typet : public typet
867867 }
868868};
869869
870+ // base class for SVA named sequences and properties
871+ class verilog_sva_named_sequence_property_typet : public typet
872+ {
873+ public:
874+ class portt : public irept
875+ {
876+ public:
877+ portt (irep_idt _identifier, typet _type) : irept(ID_symbol)
878+ {
879+ identifier (_identifier);
880+ type () = std::move (_type);
881+ }
882+
883+ typet &type ()
884+ {
885+ return static_cast <typet &>(add (ID_type));
886+ }
887+
888+ const typet &type () const
889+ {
890+ return static_cast <const typet &>(find (ID_type));
891+ }
892+
893+ irep_idt identifier () const
894+ {
895+ return get (ID_identifier);
896+ }
897+
898+ void identifier (irep_idt _identifier)
899+ {
900+ set (ID_identifier, _identifier);
901+ }
902+
903+ const source_locationt &source_location () const
904+ {
905+ return (const source_locationt &)find (ID_C_source_location);
906+ }
907+ };
908+
909+ using portst = std::vector<portt>;
910+
911+ verilog_sva_named_sequence_property_typet (irep_idt _id, portst _ports)
912+ : typet(_id)
913+ {
914+ ports () = std::move (_ports);
915+ }
916+
917+ portst &ports ()
918+ {
919+ return (portst &)(add (ID_ports).get_sub ());
920+ }
921+
922+ const portst &ports () const
923+ {
924+ return (const portst &)(find (ID_ports).get_sub ());
925+ }
926+ };
927+
928+ // / SVA named properties
929+ class verilog_sva_named_property_typet
930+ : public verilog_sva_named_sequence_property_typet
931+ {
932+ public:
933+ explicit verilog_sva_named_property_typet (portst _ports)
934+ : verilog_sva_named_sequence_property_typet{
935+ ID_verilog_sva_named_property,
936+ std::move (_ports)}
937+ {
938+ }
939+ };
940+
941+ // / SVA named sequences
942+ class verilog_sva_named_sequence_typet
943+ : public verilog_sva_named_sequence_property_typet
944+ {
945+ public:
946+ explicit verilog_sva_named_sequence_typet (portst _ports)
947+ : verilog_sva_named_sequence_property_typet{
948+ ID_verilog_sva_named_sequence,
949+ std::move (_ports)}
950+ {
951+ }
952+ };
953+
870954#endif
0 commit comments