<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Downloading Overlays
This notebook demonstrates how to download an FPGA overlay and examine programmable logic state.  
1. Instantiating an overlay
To instantiate an overlay, a bitstream file name is passed to the Overlay class.
The bitstream file does not need a full path if it resides in the pynq package, but a full path can be used for any bitstream located on the Linux file system.  Two examples of overlay instantiation are shown below.
Step1:  In the second case, users can use absolute file path to instantiate the overlay.
Step2:  Now we can check the download timestamp for this overlay
Step3:  2. Examining the PL state
While there can be multiple overlay instances in Python, there is only one bitstream that is currently loaded onto the programmable logic (PL). 
This bitstream state is held in the singleton class, PL, and is available for user queries.
Step4:  Users can verify whether an overlay instance is currently loaded using the Overlay is_loaded() method
Step5:  3. Overlay downloading overhead
Finally, using Python, we can see the bitstream download time over 50 downloads.
<ASSISTANT_TASK:>
Python Code:
# Using base.bit located in pynq package
from pynq import Overlay
ol = Overlay("base.bit")
Explanation: Downloading Overlays
This notebook demonstrates how to download an FPGA overlay and examine programmable logic state.  
1. Instantiating an overlay
To instantiate an overlay, a bitstream file name is passed to the Overlay class.
The bitstream file does not need a full path if it resides in the pynq package, but a full path can be used for any bitstream located on the Linux file system.  Two examples of overlay instantiation are shown below.
End of explanation
# Using the same bitstream, but with full path
from pynq import Overlay
ol = Overlay("/home/xilinx/pynq/bitstream/base.bit")
Explanation: In the second case, users can use absolute file path to instantiate the overlay.
End of explanation
ol.download()
ol.bitstream.timestamp
Explanation: Now we can check the download timestamp for this overlay
End of explanation
from pynq import PL
PL.bitfile_name
PL.timestamp
Explanation: 2. Examining the PL state
While there can be multiple overlay instances in Python, there is only one bitstream that is currently loaded onto the programmable logic (PL). 
This bitstream state is held in the singleton class, PL, and is available for user queries.
End of explanation
ol.is_loaded()
Explanation: Users can verify whether an overlay instance is currently loaded using the Overlay is_loaded() method
End of explanation
import time
import matplotlib.pyplot as plt
from pynq import Overlay
ol1 = Overlay("base.bit")
length = 50
log1 = []
for i in range(length):
    start = time.time()
    ol1.download()
    end = time.time()
    # Record milliseconds
    log1.append((end-start)*1000)
# Draw the figure
%matplotlib inline
plt.plot(range(length), log1, 'ro')
plt.title('Bitstream loading time (ms)')
plt.axis([0, length, 0, 1000])
plt.show()
del ol1
Explanation: 3. Overlay downloading overhead
Finally, using Python, we can see the bitstream download time over 50 downloads.
End of explanation
<END_TASK>