Author Topic: Need some video Lecture to understand OOPS with System verilog  (Read 3155 times)

0 Members and 1 Guest are viewing this topic.

Offline audioTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: in
Hi all,

   Need some video Lectures to understand OOPS, Basically i am under grad Student who have studied only C.

Now I am Learning SYSTEM VERILOG by self study, When i went to the constructor, how to copy objects(DEEP COPY or Shallow Copy)
I cant understand the concepts.

Suggest me some video lectures and books which could be useful for studying system Verilog

Thank you all.
« Last Edit: June 27, 2023, 05:50:04 pm by audio »
 

Offline AK6DN

  • Regular Contributor
  • *
  • Posts: 55
  • Country: us
Re: Need some video Lecture to understand OOPS with System verilog
« Reply #1 on: June 27, 2023, 10:03:37 pm »
Hi all,

   Need some video Lectures to understand OOPS, Basically i am under grad Student who have studied only C.

Now I am Learning SYSTEM VERILOG by self study, When i went to the constructor, how to copy objects(DEEP COPY or Shallow Copy)
I cant understand the concepts.

Suggest me some video lectures and books which could be useful for studying system Verilog

Thank you all.

How about this for an overview: 
 

Offline audioTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: in
Re: Need some video Lecture to understand OOPS with System verilog
« Reply #2 on: July 01, 2023, 06:06:00 am »
HI all

I request to suggest some books on OOPS or methods to understand System Verilog in a easier way. Thank You.
« Last Edit: July 02, 2023, 02:17:44 pm by audio »
 

Offline audioTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: in
Re: Need some video Lecture to understand OOPS with System verilog
« Reply #3 on: August 02, 2023, 09:38:11 am »
hi all,

I doesnt understand the passing object as a value for a function,function void copy (PCITop p); any body can please explain the function which has been highlighted below.

module class_TOP( );

  class PCIChild;
logic [7:0] burstC;
function new (logic [7:0] burst);
burstC = burst;
endfunction
endclass : PCIChild

  class PCITop;
logic [31:0] addrTop;
logic [31:0] dataTop;
PCIChild PCIc;// creating object for PCIChild

function new(logic [31:0] addr, logic [31:0] data, logic[7:0] burst);
PCIc = new(burst); //instantiate PCIc
addrTop = addr;
dataTop = data;
endfunction
function void copy (PCITop p);
addrTop = p.addrTop;
dataTop = p.dataTop;
PCIc.burstC = p.PCIc.burstC;
endfunction

function void disp (string instName);
$display("[%s] addr = %h data = %h burst=%h", instName, addrTop, dataTop, PCIc.burstC);
endfunction
endclass : PCITop
PCITop PCI1, PCI2;
initial begin;
PCI1 = new (32'h 0000_00ff, 32'h f0f0_f0f0, 8'h12);
PCI1.disp("PCI1");
PCI2 = new (1,2,3);
PCI2.copy(PCI1); //deep copy PCI1 into PCI2
PCI2.disp("PCI2"); //copied content displayed
PCI2.addrTop = 32'h1234_5678;
PCI2.dataTop = 32'h5678_abcd;
PCI2.PCIc.burstC = 8'h 9a;
PCI2.disp("PCI2");
PCI1.disp("PCI1");
end
endmodule
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf